zoukankan      html  css  js  c++  java
  • paip.广告过滤系统 php 实现

    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
  • 相关阅读:
    正则表达式知识
    网页边上的弹窗
    表格的搜索
    表格的删除与添加
    添加标签和删除标签
    延迟提示框
    js知识
    反射的应用
    java反射知识
    事务的特性和隔离级别
  • 原文地址:https://www.cnblogs.com/attilax/p/5964108.html
Copyright © 2011-2022 走看看