lcfirst
(PHP 5 >= 5.3.0, PHP 7, PHP 8)
lcfirst — 使一個字串的第一個字元小寫
說明
   lcfirst(string 
  $str): string
   返回第一個字母小寫的 str ,如果是字母的話。
  
需要注意的是「字母」是由目前語言區域決定的。比如,在預設的「C」區域像日耳曼語系中的元音變音a (ä) 將不會被轉換。
參數
- 
str
- 
      輸入的字串。 
返回值
返回轉換后的字串。
範例
示例 #1 lcfirst() 例子:
<?php
$foo = 'HelloWorld';
$foo = lcfirst($foo);             // helloWorld
$bar = 'HELLO WORLD!';
$bar = lcfirst($bar);             // hELLO WORLD!
$bar = lcfirst(strtoupper($bar)); // hELLO WORLD!
?>
參見
- ucfirst() - 將字串的首字母轉換為大寫
- strtolower() - 將字串轉化為小寫
- strtoupper() - 將字串轉化為大寫
- ucwords() - 將字串中每個單詞的首字母轉換為大寫