标题: 如何去掉文章里的 html 语法 
France
中校
Rank: 1



UID 44418
精华 2
积分 1656
帖子 798
威望 16
金币 818
热心 0
阅读权限 50
注册 2007-2-18
状态 离线
如何去掉文章里的 html 语法 

<?
$a="<font color=red>这是一个带HTML标识的字串</font>";
$a=strip_tags($a);
print $a;
?>
2
<?
$a="<font color=red>这是一个带HTML标识的字串</font>";
ereg_replace("^<.+>$", "", $a);
print $a;
?>
3 保留原有内容
<?
$a="<font color=red>这是一个带HTML标识的字串</font>";
ereg_replace("<", "<", $a);
ereg_replace(">", ">", $a);
print $a;
?>

顶部
[广告] 免费域名(Free Subdomain) 免费空间(Free hosting) PR查询(Google Pagerank)



当前时区 GMT+8, 现在时间是 2008-10-11 17:15
信产部ICP备案:京ICP备05066424号 北京市公安局网监备案:1101050648号

Powered by Discuz! 5.5.0
清除 Cookies - 联系我们 - 网友俱乐部 - Archiver - WAP