校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 知識庫 > PHP中過濾常用標(biāo)簽的正則表達(dá)式

PHP中過濾常用標(biāo)簽的正則表達(dá)式

熱門標(biāo)簽:哈爾濱公司外呼系統(tǒng)代理 自己做的電銷機(jī)器人 浙江營銷外呼系統(tǒng)有哪些 上海銷售電銷機(jī)器人軟件 淄博市張店區(qū)地圖標(biāo)注 惠安地圖標(biāo)注 山東外呼系統(tǒng)聯(lián)系方式 地圖標(biāo)注店鋪地圖標(biāo)注酒店 遼寧秒客來電話機(jī)器人

我們常常會用到PHP過濾一些標(biāo)簽的功能,比如過濾鏈接標(biāo)簽、過濾script標(biāo)簽等等,下面就介紹一下PHP過濾常用標(biāo)簽的正則表達(dá)式代碼:

$str=preg_replace("/\s+/", " ", $str); //過濾多余回車
$str=preg_replace("/[ ]+/si","",$str); //過濾__(""號后面帶空格)
$str=preg_replace("/\!–.*?–>/si","",$str); //注釋
$str=preg_replace("/(\!.*?)>/si","",$str); //過濾DOCTYPE
$str=preg_replace("/(\/?html.*?)>/si","",$str); //過濾html標(biāo)簽
$str=preg_replace("/(\/?head.*?)>/si","",$str); //過濾head標(biāo)簽
$str=preg_replace("/(\/?meta.*?)>/si","",$str); //過濾meta標(biāo)簽
$str=preg_replace("/(\/?body.*?)>/si","",$str); //過濾body標(biāo)簽
$str=preg_replace("/(\/?link.*?)>/si","",$str); //過濾link標(biāo)簽
$str=preg_replace("/(\/?form.*?)>/si","",$str); //過濾form標(biāo)簽
$str=preg_replace("/cookie/si","COOKIE",$str); //過濾COOKIE標(biāo)簽
$str=preg_replace("/(applet.*?)>(.*?)(\/applet.*?)>/si","",$str); //過濾applet標(biāo)簽
$str=preg_replace("/(\/?applet.*?)>/si","",$str); //過濾applet標(biāo)簽
$str=preg_replace("/(style.*?)>(.*?)(\/style.*?)>/si","",$str); //過濾style標(biāo)簽
$str=preg_replace("/(\/?style.*?)>/si","",$str); //過濾style標(biāo)簽
$str=preg_replace("/(title.*?)>(.*?)(\/title.*?)>/si","",$str); //過濾title標(biāo)簽
$str=preg_replace("/(\/?title.*?)>/si","",$str); //過濾title標(biāo)簽
$str=preg_replace("/(object.*?)>(.*?)(\/object.*?)>/si","",$str); //過濾object標(biāo)簽
$str=preg_replace("/(\/?objec.*?)>/si","",$str); //過濾object標(biāo)簽
$str=preg_replace("/(noframes.*?)>(.*?)(\/noframes.*?)>/si","",$str); //過濾noframes標(biāo)簽
$str=preg_replace("/(\/?noframes.*?)>/si","",$str); //過濾noframes標(biāo)簽
$str=preg_replace("/(i?frame.*?)>(.*?)(\/i?frame.*?)>/si","",$str); //過濾frame標(biāo)簽
$str=preg_replace("/(\/?i?frame.*?)>/si","",$str); //過濾frame標(biāo)簽
$str=preg_replace("/(script.*?)>(.*?)(\/script.*?)>/si","",$str); //過濾script標(biāo)簽
$str=preg_replace("/(\/?script.*?)>/si","",$str); //過濾script標(biāo)簽
$str=preg_replace("/javascript/si","Javascript",$str); //過濾script標(biāo)簽
$str=preg_replace("/vbscript/si","Vbscript",$str); //過濾script標(biāo)簽
$str=preg_replace("/on([a-z]+)\s*=/si","On\\1=",$str); //過濾script標(biāo)簽
$str=preg_replace("/#/si","#",$str); //過濾script標(biāo)簽

您可能感興趣的文章:
  • php使用正則過濾js腳本代碼實(shí)例
  • php正則過濾html標(biāo)簽、空格、換行符的代碼(附說明)
  • php過濾HTML標(biāo)簽、屬性等正則表達(dá)式匯總
  • PHP過濾★等特殊符號的正則
  • php 正則 過濾html 的超鏈接
  • PHP正則表達(dá)式過濾html標(biāo)簽屬性(DEMO)
  • PHP使用正則表達(dá)式實(shí)現(xiàn)過濾非法字符串功能示例
  • php正則刪除img標(biāo)簽的方法示例
  • php正則刪除html代碼中class樣式屬性的方法
  • phpstorm 正則匹配刪除空行、注釋行(替換注釋行為空行)
  • PHP正則過濾處理微信昵稱中emoji字符的方法

標(biāo)簽:銅川 宣城 西安 泰州 長沙 綿陽 無錫 重慶

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《PHP中過濾常用標(biāo)簽的正則表達(dá)式》,本文關(guān)鍵詞  PHP,中,過濾,常用,標(biāo)簽,的,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《PHP中過濾常用標(biāo)簽的正則表達(dá)式》相關(guān)的同類信息!
  • 本頁收集關(guān)于PHP中過濾常用標(biāo)簽的正則表達(dá)式的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 高邮市| 开封县| 高安市| 平利县| 灵川县| 错那县| 陵水| 盐亭县| 龙泉市| 冷水江市| 浦县| 隆子县| 佳木斯市| 鄂伦春自治旗| 黎平县| 分宜县| 奉化市| 嫩江县| 岳阳县| 民丰县| 寿阳县| 武冈市| 岳阳市| 曲周县| 马边| 铜川市| 上饶县| 修武县| 龙泉市| 含山县| 邮箱| 罗山县| 大姚县| 上栗县| 信丰县| 三原县| 广汉市| 迁西县| 沂南县| 自贡市| 长海县|