php正则过滤html标签_空格_换行符的代码,PHP 正则过滤 html 标签、空格、换行符的代码 (文章格式化)...
$str=preg_replace("/\s+/", " ", $str); //過濾多余回車
$str=preg_replace("/
$str=preg_replace("//si","",$str); //注釋
$str=preg_replace("//si","",$str); //過濾DOCTYPE
$str=preg_replace("//si","",$str); //過濾html標簽
$str=preg_replace("//si","",$str); //過濾head標簽
$str=preg_replace("//si","",$str); //過濾meta標簽
$str=preg_replace("//si","",$str); //過濾body標簽
$str=preg_replace("//si","",$str); //過濾link標簽
$str=preg_replace("//si","",$str); //過濾form標簽
$str=preg_replace("/cookie/si","COOKIE",$str); //過濾COOKIE標簽
$str=preg_replace("/(.*?)/si","",$str); //過濾applet標簽
$str=preg_replace("//si","",$str); //過濾applet標簽
$str=preg_replace("/(.*?)/si","",$str); //過濾style標簽
$str=preg_replace("//si","",$str); //過濾style標簽
$str=preg_replace("/(.*?)/si","",$str); //過濾title標簽
$str=preg_replace("//si","",$str); //過濾title標簽
$str=preg_replace("/(.*?)/si","",$str); //過濾object標簽
$str=preg_replace("//si","",$str); //過濾object標簽
$str=preg_replace("/(.*?)/si","",$str); //過濾noframes標簽
$str=preg_replace("//si","",$str); //過濾noframes標簽
$str=preg_replace("/(.*?)/si","",$str); //過濾frame標簽
$str=preg_replace("//si","",$str); //過濾frame標簽
$str=preg_replace("/(.*?)/si","",$str); //過濾script標簽
$str=preg_replace("//si","",$str); //過濾script標簽
$str=preg_replace("/javascript/si","Javascript",$str); //過濾script標簽
$str=preg_replace("/vbscript/si","Vbscript",$str); //過濾script標簽
$str=preg_replace("/on([a-z]+)\s*=/si","On\\1=",$str); //過濾script標簽
$str=preg_replace("//si","&#",$str); //過濾script標簽,如javAsCript:alert(
總結
以上是生活随笔為你收集整理的php正则过滤html标签_空格_换行符的代码,PHP 正则过滤 html 标签、空格、换行符的代码 (文章格式化)...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 银行卡不想要了怎么注销
- 下一篇: laya 怎么生成签名_PHP开发API