首页 > Web开发 > 详细

php HTML安全过滤

时间:2016-02-02 15:03:21      阅读:190      评论:0      收藏:0      [点我收藏+]
  /*HTML安全过滤*/ 
        function _htmtocode($content) { 
                $content = str_replace(‘%‘,‘%‎‘,$content); 
                $content = str_replace("<", "&lt;", $content); 
                $content = str_replace(">", "&gt;", $content);             
                $content = str_replace("\n", "<br/>", $content); 
                $content = str_replace(" ", "&nbsp;", $content); 
                $content = str_replace(‘"‘, "&quot;", $content); 
                $content = str_replace("‘", "&#039;", $content); 
                $content = str_replace("$", "&#36;", $content); 
                $content = str_replace(‘}‘,‘&rlm;}‘,$content); 
                return $content; 
        } 

 

php HTML安全过滤

原文:http://www.cnblogs.com/wuheng1991/p/5177297.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!