lcfirst

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

lcfirst使一個字符串的第一個字符小寫

說明

lcfirst(string $str): string

返回第一個字母小寫的 str ,如果是字母的話。

需要注意的是“字母”是由當前語言區(qū)域決定的。比如,在默認的“C”區(qū)域像日耳曼語系中的元音變音a (?) 將不會被轉換。

參數(shù)

str

輸入的字符串。

返回值

返回轉換后的字符串。

范例

示例 #1 lcfirst() 例子:

<?php
$foo 
'HelloWorld';
$foo lcfirst($foo);             // helloWorld

$bar 'HELLO WORLD!';
$bar lcfirst($bar);             // hELLO WORLD!
$bar lcfirst(strtoupper($bar)); // hELLO WORLD!
?>

參見