Facebook Page Twitter Page LinkedIn Page
× PHP Tutorial PHP Advanced PHP Resources


The PHP lcfirst() function is used to return the string with first character of the specified string in the lowercase. Any symbol, space, special character or number in the string is ignored while applying this function. Only Alphabets are converted.

Syntax

lcfirst(string)

Parameters

string Required. Specify the string to convert

Return Value

Returns the string with first character of the specified string in lowercase.

Example:

In the below example, lcfirst() function to used to return a string with first character of the string MyString in lowercase.

<?php
  $MyString = "Hello world!";
  $NewString = lcfirst($MyString);

  echo $NewString."\n";
?>

The output of the above code will be:

hello world!

❮ PHP String functions