武汉SEO
时光静好,与君语;细水流年,与君同;繁华落尽,与君老...

网站使用技巧>正文

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

2014-08-25 14:37
$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);

本文链接:https://www.0937.biz/post-177.html