The lcfirst() function converts the first character of a string to lowercase.
PHP lcfirst() Function has the following syntax.
lcfirst(string)
Parameter | Is Required | Description |
---|---|---|
string | Required. | String to convert |
PHP lcfirst() Function returns the converted string.
Convert the first character of "Hello" to lowercase:
<?php
echo lcfirst("Hello world from java2s.com!");
?>
The code above generates the following result.