PHP lcfirst() function with example

By IncludeHelp Last updated : December 27, 2023

PHP lcfirst() function

The lcfirst() function is a string function, it is used to convert first character to lowercase. It accepts string and returns string with first lowercase character.


The syntax of the lcfirst() function:



The parameters of the lcfirst() function:

  • string: An input parameter.

Sample Input/Output

Input: "THIS is MY computer!"
Output: "tHIS is MY computer!"

Example of PHP lcfirst() Function

$str = "THIS is MY computer!";

echo (lcfirst($str));


The output of the above example is:

tHIS is MY computer!

To understand the above example, you should have the basic knowledge of the following PHP topics:

All PHP Programs

Comments and Discussions!

Load comments ↻

Copyright © 2024 All rights reserved.