如何去掉文章里的 html 语法
更新时间:2006年10月09日 00:00:00 作者:
<?
$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;
?>
$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;
?>
相关文章
分享下PHP register_globals 值为on与off的理解
从 PHP4.2.0版本开始,php.ini中的设置选项 register_globals 默认值变成了 off。所以,最好从现在就开始用Off的风格开始编程2013-09-09
PHP simplexml_load_string()函数实例讲解
今天小编就为大家分享一篇关于PHP simplexml_load_string()函数实例讲解,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧2019-02-02


最新评论