亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

  • 站長資訊網(wǎng)
    最全最豐富的資訊網(wǎng)站

    php語句單詞首字母大寫怎么轉(zhuǎn)換

    在PHP中,可以使用ucwords()函數(shù)將單詞首字母進行大寫轉(zhuǎn)換;該函數(shù)的作用是把字符串中每個單詞的首字母轉(zhuǎn)換為大寫,其語法為“ucwords(str)”,其參數(shù)str表示要轉(zhuǎn)換的字符串,使用時只需將字符串傳入str即可。

    php語句單詞首字母大寫怎么轉(zhuǎn)換

    本教程操作環(huán)境:windows7系統(tǒng)、PHP7.1版,DELL G3電腦

    在PHP中,可以使用ucwords()函數(shù)將單詞首字母進行大寫轉(zhuǎn)換。

    ucwords() 函數(shù)把字符串中每個單詞的首字符轉(zhuǎn)換為大寫。

    注釋:該函數(shù)是二進制安全的。

    語法

    ucwords(string)

    參數(shù)string :必需。規(guī)定要轉(zhuǎn)換的字符串。

    返回值:返回已轉(zhuǎn)換的字符串。

    代碼示例:

    <?php $foo = 'hello world!'; $foo = ucwords($foo);             // Hello World! echo $foo."<br>";  $bar = 'HELLO WORLD!'; $bar = ucwords($bar);             // HELLO WORLD! echo $bar."<br>"; $bar = ucwords(strtolower($bar)); // Hello World! echo $bar; ?>

    輸出:

    Hello World! HELLO WORLD! Hello World!

    推薦學(xué)習:《PHP視頻教程》

    贊(0)
    分享到: 更多 (0)
    網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號