$str=preg_replace("/</!--.*?-->/si","",$str) " /> 精品不卡一区二区三区,国产精品羞羞答答在线观看,日韩成人av电影

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

php正則過濾html標(biāo)簽、空格、換行符的代碼(附說明)

復(fù)制代碼 代碼如下:
$str=preg_replace("http://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)簽,如JavasCript:alert(

php技術(shù)php正則過濾html標(biāo)簽、空格、換行符的代碼(附說明),轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 建始县| 镇坪县| 博野县| 沂水县| 平遥县| 嵊泗县| 怀化市| 务川| 遂宁市| 六盘水市| 叶城县| 女性| 利辛县| 稷山县| 米林县| 崇明县| 墨竹工卡县| 泊头市| 田林县| 米脂县| 汾西县| 潢川县| 秦皇岛市| 屏南县| 玉林市| 瑞昌市| 乌拉特后旗| 永新县| 琼中| 江口县| 鹤峰县| 保靖县| 本溪| 禹城市| 龙岩市| 普宁市| 克什克腾旗| 禹州市| 涪陵区| 新津县| 攀枝花市|