在ecshop中过滤HTML字段

function text_html($txt){ //过滤掉html标记

$txt = str_replace("  "," ",$txt);

$txt = str_replace("<","<",$txt);

$txt = str_replace(">",">",$txt);

$txt = preg_replace("/[ ]{1,}/isu","

",$txt);

return $txt;

}

function clearhtml($str){ //清除调html标记

$str = str_replace('<','<',$str);

$str = str_replace('>','>',$str);

return $str;

}

(0)

相关推荐