lcfirst
Makes the first letter of a string lowercase.
Syntax
lcfirst(string $string): stringParameters
| Parameter | Type | Description |
|---|---|---|
| $string | string | The input string. |
Return value
stringThe string with a lowercase first letter.
Examples
From PascalCase to camelCase:
<?php
echo lcfirst('UserName');Output:
userNameNotes
Works with ASCII letters only. The other letters of the string are unchanged.
See also
- ucfirst — Makes the first letter of a string uppercase.
- ucwords — Uppercases the first letter of every word.
- strtolower — Converts ASCII letters to lowercase.
Related recipes
In the tutorial
- Strings — Working with strings in PHP — quotes, concatenation, length, searching, replacing and multibyte functions.