The ucfirst() function is used for the first character of a string to uppercase.
ucfirst ( string $string ) : string
Parameter Name | Descrption |
---|---|
$string | Required, The input string. |
Returns the converted string.
$string = 'test string'; $string = ucfirst($string); echo $string; //Test string $string = 'TEST STRING'; $string = ucfirst($string); echo $string; //TEST STRING
Related Functions