濮阳杆衣贸易有限公司

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

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

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

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

$str=preg_replace("/\s+/", " ", $str); //過濾多余回車
$str=preg_replace("/[ ]+/si","",$str); //過濾__(""號(hào)后面帶空格)
$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過濾★等特殊符號(hào)的正則
  • 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)簽:銅川 宣城 西安 泰州 長(zhǎng)沙 綿陽(yáng) 無錫 重慶

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《PHP中過濾常用標(biāo)簽的正則表達(dá)式》,本文關(guān)鍵詞  PHP,中,過濾,常用,標(biāo)簽,的,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《PHP中過濾常用標(biāo)簽的正則表達(dá)式》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于PHP中過濾常用標(biāo)簽的正則表達(dá)式的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    沾益县| 淮南市| 绩溪县| 留坝县| 张掖市| 墨玉县| 南木林县| 望都县| 子洲县| 麟游县| 丰宁| 郧西县| 招远市| 花莲县| 新乡县| 博客| 休宁县| 石渠县| 涪陵区| 商都县| 威海市| 阿合奇县| 林口县| 扶沟县| 巴楚县| 临邑县| 烟台市| 成武县| 峡江县| 芜湖市| 饶河县| 寻乌县| 万安县| 成武县| 本溪市| 吉木萨尔县| 镇宁| 尚志市| 平邑县| 麟游县| 左权县|