当前位置: 移动技术网 > IT编程>开发语言>PHP > 如何去掉文章里的 html 语法

如何去掉文章里的 html 语法

2019年05月21日  | 移动技术网IT编程  | 我要评论
<?
$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;
?>

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网