(PHP 5 >= 5.3.0, PHP 7, PHP 8)
lcfirst — 使一個(gè)字符串的第一個(gè)字符小寫(xiě)
$str
): string
返回第一個(gè)字母小寫(xiě)的 str
,如果是字母的話(huà)。
需要注意的是“字母”是由當前語(yǔ)言區域決定的。比如,在默認的“C”區域像日耳曼語(yǔ)系中的元音變音a (?) 將不會(huì )被轉換。
str
輸入的字符串。
返回轉換后的字符串。
示例 #1 lcfirst() 例子:
<?php
$foo = 'HelloWorld';
$foo = lcfirst($foo); // helloWorld
$bar = 'HELLO WORLD!';
$bar = lcfirst($bar); // hELLO WORLD!
$bar = lcfirst(strtoupper($bar)); // hELLO WORLD!
?>