函数
function safe_convert($string, $html=0) { //Words Filter
if ($html==0) {
$string=htmlspecialchars($string, ENT_QUOTES);
$string=str_replace(",",$string);
$string=str_replace(">",">",$string);
$string=str_replace("\\", '\', $string);
} else {
$string=addslashes($string);
$string=str_replace("\\\\", '\', $string);
}
$string=str_replace("\r","
",$string);
$string=str_replace("\n","",$string);
$string=str_replace("\t"," ",$string);
$string=str_replace(" "," ",$string);
$string=str_replace('|', '|', $string);
$string=str_replace("`","`",$string);
$string=str_replace("\","\",$string);
return $string;
}