如何去掉文章里的 html 語法
更新時間:2006年10月09日 00:00:00 作者:
<?
$a="<font color=red>這是一個帶HTML標(biāo)識的字串</font>";
$a=strip_tags($a);
print $a;
?>
2
<?
$a="<font color=red>這是一個帶HTML標(biāo)識的字串</font>";
ereg_replace("^<.+>$", "", $a);
print $a;
?>
3 保留原有內(nèi)容
<?
$a="<font color=red>這是一個帶HTML標(biāo)識的字串</font>";
ereg_replace("<", "<", $a);
ereg_replace(">", ">", $a);
print $a;
?>
$a="<font color=red>這是一個帶HTML標(biāo)識的字串</font>";
$a=strip_tags($a);
print $a;
?>
2
<?
$a="<font color=red>這是一個帶HTML標(biāo)識的字串</font>";
ereg_replace("^<.+>$", "", $a);
print $a;
?>
3 保留原有內(nèi)容
<?
$a="<font color=red>這是一個帶HTML標(biāo)識的字串</font>";
ereg_replace("<", "<", $a);
ereg_replace(">", ">", $a);
print $a;
?>
相關(guān)文章
網(wǎng)站加速 PHP 緩沖的免費實現(xiàn)方法
網(wǎng)站加速 PHP 緩沖的免費實現(xiàn)方法...2006-10-10在Windows中安裝Apache2和PHP4的權(quán)威指南
在Windows中安裝Apache2和PHP4的權(quán)威指南...2006-10-10PHP數(shù)據(jù)庫操作面向?qū)ο蟮膬?yōu)點
PHP數(shù)據(jù)庫操作面向?qū)ο蟮膬?yōu)點...2006-10-10