ucfirst
Set the first character of the string to uppercase
ucfirst() function converts the first character in the string to uppercase.
lcfirst() - Convert first character in a string to lowercasestrtolower() - Convert strings to lowercasestrtoupper() - Convert string to uppercaseucwords() - Convert the first character of each word in a string to uppercaseConvert the first character of "hello" to uppercase:
<?php echo ucfirst ( "hello world!" ) ; ?>
Try it yourself
ucfirst( string )
| parameter | describe |
|---|---|
| string | Required. Specifies the string to be converted. |