/*HTML安全过滤*/ function _htmtocode($content) { $content = str_replace(‘%‘,‘%‎‘,$content); $content = str_replace("<", "<", $content); $content = str_replace(">", ">", $content); $content = str_replace("\n", "<br/>", $content); $content = str_replace(" ", " ", $content); $content = str_replace(‘"‘, """, $content); $content = str_replace("‘", "'", $content); $content = str_replace("$", "$", $content); $content = str_replace(‘}‘,‘‏}‘,$content); return $content; }
原文:http://www.cnblogs.com/wuheng1991/p/5177297.html