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

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

          php中將字符串首字母進行大小寫轉換的方法有哪些

          php中將字符串首字母進行大小寫轉換的方法有哪些

          每個單詞的首字母轉換為大寫:ucwords()

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

          相關視頻教程推薦:php視頻教程

          第一個單詞首字母變大寫:ucfirst()

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

          第一個單詞首字母變小寫:lcfirst()

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

          知識點補充:

          所有字母變大寫:strtoupper()

          所有字母變小寫:strtolower()

          相關文章教程推薦:php教程

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