日期:2014-05-17  浏览次数:20374 次

用php正则过滤程序标记开头到结尾全部过滤掉,请看说明
用php正则过滤,比如:<? echo"ddfdf";?> 这段全部过滤掉,还有分别<%...%> <php...?>等所有的带服务器端程序标记全部给过滤掉

------解决方案--------------------
preg_replace("#<([?%]).*?\\1>#s", "", $str);
------解决方案--------------------
preg_replace("/(<[\?%]+.*[\?%]+>)/gi","",$str);