Javatpoint Logo
Javatpoint Logo

PHP string lcfirst() Function

The lcfirst() is in-built PHP string function. It is used to convert the first character of a string to lowercase. In another words we can say that it make a string's first character lowercase. It returns the converted string.

Following are the related functions.

  • ucfirst() : It is used to convert first character of a string to uppercase.
  • ucwords() : It is used to convert first character string to uppercase.
  • strtoupper() : It is used to convert a string to uppercase.
  • strtolower() : It is used to convert a string to lowercase.

Syntax:

Parameter Description Required/Optional
String Specify the string to convert required

Example 1

Output:

Before using lcfirst() function:PHP
After using 'lcfirst()' function: pHP

Example 2

Output:

Before using lcfirst() function: HELLO PHP
After using 'lcfirst()' function: hELLO PHP

Next TopicPHP String




Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA