打印

如何去掉文章里的 html 语法

如何去掉文章里的 html 语法

1

<?
$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;
?>   

TOP

当前时区 GMT-4, 现在时间是 2009-1-9 18:14
ComePlay8.Com
Powered by Discuz! 6.0.0 © 2001-2007 Comsenz Inc.
Processed in 0.108454 second(s), 10 queries, Gzip enabled
TOP
清除 Cookies - 联系我们 - 来玩吧 - Archiver - WAP
Designed By Discuz! Support Team