一直都发现这个问题了,写心情时,如果写&会出错,写$会不显示!
wap特殊字符处理函数:
<?php
function unhtml($content)
{
$content=str_replace("&","&",$content);
$content=str_replace("<","<",$content);
$content=str_replace(">",">",$content);
$content=str_replace(chr(13),"<br>",$content);
$content=str_replace("","",$content);
$content=str_replace("$","$$",$content);
$content=str_replace("我日","不文明用语",$content);
$content=str_replace(chr(34),""",$content);
/*
$content=str_replace(" "," ",$content);
$content=str_replace("[emt]","<img src=images/xyq/",$content);
$content=str_replace("[/emt]",".gif/>",$content);
*/
return $content;
}
echo unhtml($row["content"]);
?>
asp版处理:
<%
content=replace(rs("content"),"&","&")
content=replace(content,"<","<")
content=replace(content,">",">")
content=replace(content,chr(13),"<br>")
content=replace(content,"","")
content=replace(content,"$","$$")
content=replace(content,"我日","不文明用语")
content=replace(content,chr(34),"""")
response.write content
%>