欧美亚洲中文,在线国自产视频,欧洲一区在线观看视频,亚洲综合中文字幕在线观看

      1. <dfn id="rfwes"></dfn>
          <object id="rfwes"></object>
        1. 站長(zhǎng)資訊網(wǎng)
          最全最豐富的資訊網(wǎng)站

          php中將字符串首字母進(jìn)行大小寫(xiě)轉(zhuǎn)換的方法有哪些

          php中將字符串首字母進(jìn)行大小寫(xiě)轉(zhuǎn)換的方法有哪些

          每個(gè)單詞的首字母轉(zhuǎn)換為大寫(xiě):ucwords()

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

          相關(guān)視頻教程推薦:php視頻教程

          第一個(gè)單詞首字母變大寫(xiě):ucfirst()

          <?php $foo = 'hello world!'; $foo = ucfirst($foo);             // Hello world!   $bar = 'HELLO WORLD!'; $bar = ucfirst($bar);             // HELLO WORLD! $bar = ucfirst(strtolower($bar)); // Hello world! ?>

          第一個(gè)單詞首字母變小寫(xiě):lcfirst()

          <?php $foo = 'HelloWorld'; $foo = lcfirst($foo);             // helloWorld   $bar = 'HELLO WORLD!'; $bar = lcfirst($bar);             // hELLO WORLD! $bar = lcfirst(strtoupper($bar)); // hELLO WORLD! ?>

          知識(shí)點(diǎn)補(bǔ)充:

          所有字母變大寫(xiě):strtoupper()

          所有字母變小寫(xiě):strtolower()

          相關(guān)文章教程推薦:php教程

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