PHP 字符串 lcfirst()函數(shù)
lcfirst()是內(nèi)置的PHP字符串函數(shù)。愛(ài)掏網(wǎng) - it200.com它用于將字符串的第一個(gè)字符轉(zhuǎn)換為小寫(xiě)。愛(ài)掏網(wǎng) - it200.com換句話(huà)說(shuō),它可以將字符串的第一個(gè)字符轉(zhuǎn)換為小寫(xiě)。愛(ài)掏網(wǎng) - it200.com它返回轉(zhuǎn)換后的字符串。愛(ài)掏網(wǎng) - it200.com
以下是相關(guān)的函數(shù):
- ucfirst() :將字符串的第一個(gè)字符轉(zhuǎn)換為大寫(xiě)。愛(ài)掏網(wǎng) - it200.com
- ucwords() :將字符串的每個(gè)單詞的第一個(gè)字符轉(zhuǎn)換為大寫(xiě)。愛(ài)掏網(wǎng) - it200.com
- strtoupper() :將字符串轉(zhuǎn)換為大寫(xiě)。愛(ài)掏網(wǎng) - it200.com
- strtolower() :將字符串轉(zhuǎn)換為小寫(xiě)。愛(ài)掏網(wǎng) - it200.com
string lcfirst ( string $str );
參數(shù) | 描述 | 必需/可選 |
---|---|---|
string | 指定要轉(zhuǎn)換的字符串 | 必需 |
示例1
<?php
echo "Before using lcfirst() function:PHP"."<br>";
arr = lcfirst("PHP");
echo "After using 'lcfirst()' function: ".arr;
?>
輸出:
Before using lcfirst() function:PHP
After using 'lcfirst()' function: pHP
示例2
<?php
echo "Before using lcfirst() function: HELLO PHP"."<br>";
arr = lcfirst("HELLO PHP");
echo "After using 'lcfirst()' function: ".arr;
?>
輸出:
Before using lcfirst() function: HELLO PHP
After using 'lcfirst()' function: hELLO PHP
聲明:所有內(nèi)容來(lái)自互聯(lián)網(wǎng)搜索結(jié)果,不保證100%準(zhǔn)確性,僅供參考。如若本站內(nèi)容侵犯了原著者的合法權(quán)益,可聯(lián)系我們進(jìn)行處理。