/*----------------------
过滤HTML代码的函数
-----------------------*/
function htmlEncode($string) {
$string=trim($string);
$string=str_replace("&","&",$string);
$string=str_replace("'","'",$string);
$string=str_replace("&","&",$string);
$string=str_replace(""",""",$string);
$string=str_replace("\"",""",$string);
$string=str_replace("<","<",$string);
$string=str_replace("<","<",$string);
$string=str_replace(">",">",$string);
$string=str_replace(">",">",$string);
$string=str_replace(" "," ",$string);
$string=nl2br($string);
return $string;
}
http://www.bkjia.com/PHPjc/318561.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/318561.htmlTechArticle/*---------------------- 过滤HTML代码的函数 -----------------------*/ functionhtmlEncode($string){ $string=trim($string); $string=str_replace("amp;",$string); $string=str_rep...