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

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

          php怎么刪除字符串中的空格

          php刪除字符串中空格的方法:1、使用str_ireplace()函數(shù),語法“str_ireplace(' ', '', $str)”;2、使用str_replace()函數(shù),語法“str_replace(' ', '', $str)”。

          php怎么刪除字符串中的空格

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

          方法1:使用str_ireplace()函數(shù)

          <?php $str = 'hello world !'; $search = ' '; $replace = ''; echo str_ireplace($search, $replace, $str); ?>

          輸出:

          helloworld!

          方法2:使用str_replace()函數(shù)

          <?php $str = 'hello world !'; $str = str_replace(' ', '', $str); echo $str; ?>

          輸出:

          helloworld!

          推薦學習:《PHP視頻教程》

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