Heim  >  Artikel  >  Backend-Entwicklung  >  如何去掉文章里的 html 语法_PHP教程

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

WBOY
WBOYOriginal
2016-07-21 16:07:19970Durchsuche


$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...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn