时光静好,与君语;细水流年,与君同;繁华落尽,与君老……
🌐 Paulblog 📅 2008 — 2026

齐博(php168)采集规则过滤超链接

✍ 作者 gbl 📅 2014-08-25 📂 👁 89 阅读
$search = array ("’<script[^>]*?>.*?</script>’si",//过滤SCRIPT标记
"’<iframe[^>]*?>.*?</iframe>’si", //过滤IFRAME标记
"’<style[^>]*?>.*?</style>’si",//过滤STYLE标记
"’<[/!]*span[^<>]*?>’si",//过滤SPAN标记
"’<[/!]*font[^<>]*?>’si",//过滤font标记
"’<[/!]*strong[^<>]*?>’si",//过滤STRONG标记
"’<[/!]*table[^<>]*?>’si",//过滤table标记
"’<[/!]*tr[^<>]*?>’si",//过滤tr标记
"’<[/!]*td[^<>]*?>’si",//过滤tbody标记
"’<[/!]*tbody[^<>]*?>’si",//过滤tbody标记
"’<[/!]*input[^<>]*?>’si",//过滤INPUT标记
"’<[/!]*a[^<>]*?>’si",//过滤A标记,如果要过滤链接中的字,必须在过滤规则中写下。
"’<div class="pagelist">.*?</div>’si", //过滤pagelist的DIV中所有内容
"’<[/!]*div[^<>]*?>’si",//过滤DIV标记
"’&#(d+);’e");
$replace = array ("",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"chr(1)");
$show_content=preg_replace($search,$replace,$show_content);
$htmlcode=preg_replace($search,$replace,$htmlcode);
暂无标签

评论

暂无评论...
验证码 换一张
取 消