示例一:将字符串中的第一个字符转换为小写
$str = "Hello World";echo lcfirst($str); // 输出:hello World示例二:结合substr函数使用,只将字符串中的第一个单词转换为小写$str = "Hello World";$firstWord = lcfirst(substr($str, 0, strpos($str, ' ')));echo $firstWord . substr($str, strpos($str, ' ')); // 输出:hello World示例三:处理数组中的每个元素,将元素的第一个字符转换为小写$array = ["Apple", "Banana", "Cherry"];$newArray = array_map('lcfirst', $array);print_r($newArray); // 输出:Array ( [0] => apple [1] => banana [2] => cherry ) 

