久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php中怎么刪除字符串中的某一元素

      php刪除字符串中某一元素的方法:1、用str_replace(),語(yǔ)法“str_replace("需要?jiǎng)h除的值","",$str)”;2、用str_ireplace(),語(yǔ)法“str_ireplace("要?jiǎng)h除的值","",$str)”。

      php中怎么刪除字符串中的某一元素

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

      php中刪除字符串中的某一元素

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

      str_replace() 函數(shù)以其他字符替換字符串中的一些字符(區(qū)分大小寫);當(dāng)替換值為空字符串""時(shí),即可實(shí)現(xiàn)刪除指定值。

      語(yǔ)法:

      str_replace(find,replace,string,count)
      參數(shù) 描述
      find 必需。規(guī)定要查找的值。
      replace 必需。規(guī)定替換 find 中的值的值。
      string 必需。規(guī)定被搜索的字符串。
      count 可選。對(duì)替換數(shù)進(jìn)行計(jì)數(shù)的變量。

      示例:

      <?php header("Content-type:text/html;charset=utf-8"); $str = 'hello,world,Hello,world'; echo "原字符串:".$str."<br>";  $search = 'hello'; $replace = '';  echo "需要?jiǎng)h除的元素:".$search."<br>"; echo "刪除指定值的字符串:".str_replace($search, $replace, $str); ?>

      php中怎么刪除字符串中的某一元素

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

      str_ireplace() 函數(shù)替換字符串中的一些字符(不區(qū)分大小寫);同樣,當(dāng)替換值為空字符串""時(shí),即可實(shí)現(xiàn)刪除指定值。

      str_ireplace() 函數(shù)和str_replace() 函數(shù)的語(yǔ)法相似,可參考上面。

      示例:

      <?php header("Content-type:text/html;charset=utf-8"); $str = 'hello,world,Hello,world'; echo "原字符串:".$str."<br>";  $search = 'hello'; $replace = '';  echo "需要?jiǎng)h除的元素:".$search."<br>"; echo "刪除指定值的字符串:".str_ireplace($search, $replace, $str); ?>

      php中怎么刪除字符串中的某一元素

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

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