·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> 网站建设开发 >> php网站开发 >> 如何去掉文章里的 html 语法

如何去掉文章里的 html 语法

作者:佚名      php网站开发编辑:admin      更新时间:2022-07-23
<?
$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;
?>