paip.广告过滤系统 php 实现

来源:互联网 发布:杭州软件测试工资 编辑:程序博客网 时间:2024/05/17 07:43
paip.广告过滤系统 php 实现




作者Attilax  艾龙,  EMAIL:1466519819@qq.com 
来源:attilax的专栏
地址:http://blog.csdn.net/attilax




------logo  过滤
RewriteRule ^(.*)img.spriteapp.cn/ws/www/img/layout/logo.png    /delad/transparentv.gif [L]


------html 过滤
+html 过滤 有基于dom的delete过滤,string 正则表达式 替换更加简单的..


RewriteRule ^(.*)\.htm$ /process.php?file=$1&%{QUERY_STRING} [L]




<?php
$param= $_GET['file'].".htm";
$url="http://latu.3g.cn/RP/EntLatu/photoappnav.php?".$param;
//echo $param;
$content=file_get_contents($param);
//从一个URL或者文件创建一个DOM对象
 
//$html = file_get_html($content);
 $content=preg_replace('<div class="web_right_down">', '<div class="web_right_down" style="display:none">', $content); 
 echo $content;
?>


------python
result, number = re.subn(regex, newstring, subject) 


参考
Python正则表达式如何进行字符串替换 - 51CTO.COM.htm
详解PHP正则表达式替换实现 - 51CTO.COM.htm
0 0