郁闷的新闻内容显示??!!
有转换成HTML特殊字符,以便在数据库中保存,在填加时候,
$title=addslashes($title);
$content=addslashes($content);
$contents=htmlspecialchars($contents);
$content=str_replace("<","<",$content);
$content=str_replace(">",">",$content);
$content=str_replace(chr(13),"<BR>",$content);
$content=str_replace(chr(32)," ",$content);
输出的时候
$title=StripSlashes($row["title"]);
$content=StripSlashes($row["content"]);
$content=nl2br($content);
$content=str_replace("<","<",$content);
$content=str_replace(">",">",$content);
$content=str_replace("<BR>",chr(13),$content);
$content=str_replace(" ",chr(32),$content);
段首空格成了“????”
郁闷!不过我$content=str_replace("??",chr(32),$content);也没有空格,
$content=str_replace("??",“ ”,$content);也不行,空格不是这样表示?
为何不认识?