PHP lcfirst() Function Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The lcfirst() function is a built-in function in PHP which takes a string as an argument and returns the string with the first character in Lower Case and all other characters remain unchanged. Syntax: lcfirst($string) Parameter: The function accepts only one parameter $string which is mandatory. This parameter represents the input string whose first character will be changed to lowercase. Return Value: The function returns the same string only by changing the first character to lower case of the passed argument $string. Examples: Input : "Geeks for geeks" Output : geeks for geeks Input : "chetna agarwal" Output : chetna agarwal Below programs illustrate the lcfirst() function in PHP: Program 1: php <?php // PHP program to demonstrates the // use of lcfirst() function $str = "Geeks for geeks"; // converts the first character to // lower case and prints the string echo(lcfirst($str)); ?> Output: geeks for geeks Program 2: The program below demonstrates the use of lcfirst() function when the starting character is already in lower-case. php <?php // PHP program that demonstrates the // use of lcfirst() function when // the first case is already in lowercase $str = "chetna agarwal"; // already the first character is in lower case // so prints the same string only echo(lcfirst($str)); ?> Output: chetna agarwal Reference: https://www.php.net/manual/en/function.lcfirst.php Create Quiz Comment C ChetnaAgarwal Follow 0 Improve C ChetnaAgarwal Follow 0 Improve Article Tags : Misc Web Technologies PHP PHP-string Explore BasicsPHP Syntax4 min readPHP Variables5 min readPHP | Functions6 min readPHP Loops4 min readArrayPHP Arrays5 min readPHP Associative Arrays4 min readMultidimensional arrays in PHP5 min readSorting Arrays in PHP4 min readOOPs & InterfacesPHP Classes2 min readPHP | Constructors and Destructors5 min readPHP Access Modifiers4 min readMultiple Inheritance in PHP4 min readMySQL DatabasePHP | MySQL Database Introduction4 min readPHP Database connection2 min readPHP | MySQL ( Creating Database )3 min readPHP | MySQL ( Creating Table )3 min readPHP AdvancePHP Superglobals6 min readPHP | Regular Expressions12 min readPHP Form Handling4 min readPHP File Handling4 min readPHP | Uploading File3 min readPHP Cookies9 min readPHP | Sessions7 min read Like