盾怪网教程:是一个免费提供流行杀毒软件教程、在线学习分享的学习平台!

PHP - Html Transfer Code

时间:2024/11/24作者:未知来源:盾怪网教程人气:

[摘要]", " ", join(" ", att_list));function html_highlight(str) color_1 ...
", " ", join(" ", $att_list));
}


function html_highlight($str) {
        $color_1 = "red";
        $color_2 = "blue";
        $color_3 = "gray";
        $str = str_replace("\\\"","\"",$str);
        preg_match_all("/<script([^>]*)>(.*)<\/script>/isU", $str, $arr_tmp);
        $arr_script = $arr_tmp[0];
        for($i=0; $i<count($arr_script); $i++) {
                $str = str_replace($arr_script[$i], "
::script_{$i}::
", $str);
                $arr_script[$i] = preg_replace("/<script([^>]*)>(.*)<\/script>/iseU", "'<font color=\'{$color_2}\'>&lt;SCRIPT '.html_highlight_attr('\\1').'&gt;</font><br />'.script_highlight(str_replace('\\\"','\"','\\2'), false).'<font color=\'{$color_2}\'>&lt;/SCRIPT&gt;</font>'", $arr_script[$i]);
        }
        $str = preg_replace("/(<textarea[^>]*>)(.*)(<\/textarea>)/ieU" ,"'\\1'.htmlspecialchars('\\2').'\\3'", $str);
        $str = preg_replace("/<!\-\-(.*)\-\->/seU" ,"'<!--'.htmlspecialchars('\\1').'-->'", $str);
        $str = preg_replace("/<style([^>]*)>(.*)<\/style>/isU" ,"<!style\\1>\\2</style!>", $str);
        $str = preg_replace("/<([a-z:]+)\s*(.*?)( \/

关键词:PHP - Html Transfer Code




Copyright © 2012-2018 盾怪网教程(http://www.dunguai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版