如何去掉文章里的 html 语法
<?
$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程序中的常见漏洞进行攻击(下) 下一篇:如何分别全角和半角以避免乱码 更多相关文章
|
推荐文章
精彩文章
|