Jump to: navigation, search

Php lcfirst

From w3cyberlearnings

Contents

PHP function lcfirst

This function converts the first letter to lowercase.

Syntax lcfirst

  • string: string input
lcfirst(string);

Example 1

<?php

$str="JOHN";
echo lcfirst($str);
?>

Output

jOHN

Example 2

<?php

$arr = array('JOHN', 'BOBMAAT', 'BILL CLIN', 'GORGE BUS');

$all_lcfirst = array_map('lcfirst', $arr);

print_r($all_lcfirst);
?>

Output

Array
(
    [0] => jOHN
    [1] => bOBMAAT
    [2] => bILL CLIN
    [3] => gORGE BUS
)

Related Functions


Navigation
Web
SQL
MISC
References