<?php
str lcfirst ( str $str )
where,
$str = The string to transform the first character in lowercase
?>
<?php
$str0010 = 'Quandoque bonus dormitat Homerus';
$str0011 = lcfirst ($str0010);
echo 'Original STRING:<br>' . $str0010 .
'<br><br>After lcfirst:<br>' . $str0011 . '<br>';
?>
<?php
$str0020 = 'Âmbito nacional';
$str0021 = lcfirst ($str0020);
echo 'Original STRING:<br>' . $str0020 .
'<br><br>After lcfirst:<br>' . $str0021 . '<br>';
?>
<?php
$str0030 = '1,2,3,4,5,6,7,8,9 for 12 missing 3';
$str0031 = lcfirst ($str0030);
echo 'Original STRING:<br>' . $str0030 .
'<br><br>After ucfirst:<br>' . $str0031 . '<br>';
?>
<?php
/* Make a string's first character lowercase */
echo "Basic and Various operations:<br><br>";
$str_array = array(
"TesTing lcfirst.",
"1.testing lcfirst",
"HELLO wORLD",
'HELLO wORLD',
"\0",
// Null
"\x00",
// Hex Null
"\x000",
"abcd",
// double quoted string
'xyz',
// single quoted string
"-3",
-3,
'-3.344',
-3.344,
NULL,
"NULL",
"0",
0,
TRUE,
// bool type
"TRUE",
"1",
1,
1.234444,
FALSE,
"FALSE",
" ",
" ",
'b',
// single char
'\t',
// escape sequences
"\t",
"12",
"12twelve",
// int + string
);
/* loop to test working of lcfirst
with different values */
foreach ($str_array as $string) {
echo $string . '<br>' . lcfirst($string) . '<br><br>';
}
?>