English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

PHP Basic Tutorial

PHP Advanced Tutorial

PHP & MySQL

PHP Reference Manual

PHP lcfirst() Function Usage and Example

PHP String Character String Functions Manual

    The lcfirst() function is used to convert the first character of a string to lowercase.

Syntax

string lcfirst ( string $str )

Definition and Usage

It is used to make the first character of the string lowercase.

Related Functions:

  • ucfirst() - Convert the first character of the string to uppercase.

  • ucwords() - Convert the first character of each word in the string to uppercase.

  • strtoupper() - Convert the string to uppercase.

  • strtolower() - Convert the string to lowercase.

Return Value

It returns the result string.

Parameter

Serial NumberParameters and Description
1

str (required)

Input String

Online Example

Try the following example to convert the first character of a string to lowercase:

<?php
   //Convert the first character of a string to lowercase.
   $input = 'w3codebox';
   $input = lcfirst($input); 
   
   echo $input;
?>
Test and See‹/›

Output Result-

w3codebox

PHP String Character String Functions Manual