Home >>PHP Tutorial >PHP lcfirst() Function

PHP lcfirst() Function

PHP lcfirst() Function

PHP lcfirst() function is used to convert the first character of a given input string to lowercase. In other words we can say that it make the first character of the string lowercase but all the other characters of the string remain unchanged. As a result it returns the new converted string. Lcfirst() function is an in-built function of PHP. It accepts only one parameter which is the input string that we have to convert.

Syntax:-

 lcfirst($string)

Parameter Values

Parameter Description
string This is a required parameter. This parameter contains the input string which is to be converted.

Here is an example of lcfirst() function in PHP:

<html>
<body>

<?php
echo lcfirst("PHPTPOINT");
?> 
 
</body>
</html>
Output:
pHPTPOINT

Here is an another example of lcfirst() function in PHP:

<html>
<body>

<?php
echo lcfirst("We Love PHP.");
?> 
 
</body>
</html>
Output:
we Love PHP.

Popular Tutorials