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

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

    php中首字母小寫轉(zhuǎn)大寫的函數(shù)是什么

    php中首字母小寫轉(zhuǎn)大寫的函數(shù):1、ucfirst()函數(shù),可將字符串的首字母轉(zhuǎn)換成大寫,語法“ucfirst($str)”;2、ucwords()函數(shù),可將字符串中每個(gè)單詞的首字母轉(zhuǎn)換為大寫,語法“ucwords($str)”。

    php中首字母小寫轉(zhuǎn)大寫的函數(shù)是什么

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

    php中首字母小寫轉(zhuǎn)大寫的函數(shù)有兩種:

    • ucfirst()函數(shù),可將字符串的首字母轉(zhuǎn)換成大寫

    • ucwords()函數(shù),可將字符串中每個(gè)單詞的首字母轉(zhuǎn)換為大寫

    1、ucfirst()函數(shù)

    ucfirst() 函數(shù)把字符串中的首字符轉(zhuǎn)換為大寫。

    示例:

    <?php echo ucfirst("hello world!"); ?>

    php中首字母小寫轉(zhuǎn)大寫的函數(shù)是什么

    2、ucwords()函數(shù)

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

    語法:

    ucwords($string [, $delimiters = "trnfv" ])

    其中,$string 為需要轉(zhuǎn)化的字符串;$delimiters 為可選參數(shù),用來表示單詞分隔符,默認(rèn)是空格符、制表符、換行符、回車符、水平線以及豎線。

    示例:

    <?php $foo = 'hello world!'; $foo = ucwords($foo);             // Hello World! echo $foo."<br>";  $foo = 'hello|world!'; $bar = ucwords($foo);             // Hello|world! echo $bar."<br>";  $baz = ucwords($foo,"|");        // Hello|World! echo $baz."<br>"; ?>

    輸出:

    Hello World! Hello|world! Hello|World!

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

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