下面这个在 文件名为 function.php里
<?php
function unhtml($content)
{
$content=str_replace("&","& a m p;",$content);
$content=str_replace("<","& l t;",$content);
$content=str_replace(">","& g t;",$content);
$content=str_replace(" ","&n b s p;",$content);
$content=str_replace(chr(13),"<br>",$content);
$content=str_replace("\\","\\\\",$content);
$content=str_replace("台什么","不文明用语",$content);
$content=str_replace(chr(34),""",$content);
$content=str_replace("[emt]","<img src=images/xyq/",$content);
$content=str_replace("[/emt]",".gif/>",$content);
return $content;
}
?>
下面在这个SHOW.php里
从数据库里读取1段文字(值给$content)
导入函数
<?php include_once("function.php");
echo unhtml($content);
?>
结果是 该屏蔽的没屏蔽 该替换的没换
比如
台什么[emt]1[/emt]
换成
不文明用语<img src=images/xyq/1.gif/>
才对嘛
我用的花生壳 看效果 就送分。
好的我在加分!