PHP lcfirst() function

Example

Convert the first character of "Hello" to lowercase:

<?php
echo lcfirst("Hello world!");
?>

Run Example

Definition and Usage

The lcfirst() function converts the first character of the string to lowercase.

Related Functions:

  • strtolower() - Convert the string to lowercase
  • strtoupper() - Convert the string to uppercase
  • ucfirst() - Convert the first character of the string to uppercase
  • ucwords() - Convert the first character of each word in the string to uppercase

Syntax

lcfirst(string)
Parameter Description
string Required. Specifies the string to be converted.

Technical Details

Return value: Return the converted string.
PHP Version: 5.3.0+