lcfirst() function in PHP || PHP lcfirst function
×


lcfirst() function in php

1741

lcfirst() function of PHP is used to converts the first character of a string to lowercase. It is an inbuilt function of PHP. The return type of this function is a string.

Syntax:

lcfirst($string);

here,

$string is a PHP string whose first character is converted to uppercase by this function.


Example 1:

<?php
$str="codingtag";
$u_str=ucfirst($str);
echo "Modified string is : $u_str";
?>

Output:

Note: In case of more than one word in a string this function will convert the first character of the first word to uppercase.

Example 2:

<?php
$str="welcome to coding tag";
$u_str=ucfirst($str);
echo "Modified string is : $u_str";
?>

Output:




Best WordPress Hosting


Share:


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price



Leave a Reply


Comments
    Waiting for your comments