PHP lcfirst() function

The lcfirst() function is used for the first character of a string to lowercase.


lcfirst ( string $string ) : string


Parameter Name Descrption
$string Required, The input string.

Return Value

Returns the converted string.

lcfirst() examples : Convert the first character of "test" to lowercase

$string = 'test string';
$string = lcfirst($string); 
echo $string;//test string

$string = 'TEST STRING';
$string = lcfirst($string);  
echo $string; //tEST STRING

Related Functions