lcfirst() 使一个字符串的第一个字符小写。
string lcfirst ( string $str )
说明:
返回str的第一个字符小写了的字符串。如果str的第一个字符是字母,则将其转换为小写。
需要注意的是"字母"是由当前语言区域决定的。比如,在默认的"C"区域像日耳曼语系中的元音变音a (?) 将不会被转换。
参数描述
str
输入的字符串。
返回值:
返回转换后的字符串。
实例:
<?php
$foo = 'HelloWorld';
$foo = lcfirst($foo);
echo $foo;
// helloWorld
$bar = 'HELLO WORLD!';
$bar = lcfirst($bar);
echo $bar;
// hELLO WORLD!
$bar = lcfirst(strtoupper($bar));
echo $bar;
// hELLO WORLD!
?>
输出:
// helloWorld
// hELLO WORLD!
// hELLO WORLD!