首頁  >  文章  >  後端開發  >  如何去掉文章里的 html 语法_PHP教程

如何去掉文章里的 html 语法_PHP教程

WBOY
WBOY原創
2016-07-21 16:07:19970瀏覽


$a="这是一个带HTML标识的字串";
$a=strip_tags($a);
print $a;
?>


2

$a="这是一个带HTML标识的字串";
ereg_replace("^<.>$", "", $a);
print $a;
?>


3 保留原有内容


$a="这是一个带HTML标识的字串";
ereg_replace("ereg_replace(">", ">", $a);
print $a;
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/315220.htmlTechArticle? $a=font color=red这是一个带HTML标识的字串/font; $a=strip_tags($a); print $a; ? 2 ? $a=font color=red这是一个带HTML标识的字串/font; ereg_replace(^.+$, , $a); pr...
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn