久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php正則怎么替換符號

      php正則替換符號的方法:首先創(chuàng)建一個PHP示例文件;然后通過正則表達(dá)式“preg_replace($regex,"",$other);”去除特殊字符即可。

      php正則怎么替換符號

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

      php 正則替換特殊字符 和檢測是否是中文

      如果是只想輸入中文的話,就這么寫,要注意是分gb2312和utf-8的哦:

      gb2312:if(!preg_match("/^[".chr(0xa1)."-".chr(0xff)."]+$/",$str))  utf-8 :if(!preg_match("/^[x{4e00}-x{9fa5}]+$/u",$str))

      去除特殊字符

      $regex = "/(/|~|!|@|#|\$|%|^|&|*|(|)|_|+|{|}|:|<|>|?|[|]|,|.|/|;|'|`|-|=|\|||"){2,}/"; $other = preg_replace($regex,"",$other); $regex = "/(,|。|!|;|:|、|’|‘|【|】|《|》|?|@|#|¥|%|&|*|(|)|-|+|=|@|…){2,}/"; $other = preg_replace($regex,"",$other);

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

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