Home >Backend Development >PHP Tutorial >How to remove html syntax from articles_PHP tutorial

How to remove html syntax from articles_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 16:07:191032browse

$a="This is a string with HTML tags";
$a=strip_tags($a);
print $ a;
?>


2
$a="This is a string with HTML tag";
ereg_replace("^<.+>$", "", $a);
print $a;
?>


3 Keep the original content

$a="This is a string with HTML tag";
ereg_replace("< ;", "<", $a);
ereg_replace(">", ">", $a);
print $a;
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/315220.htmlTechArticle? $a=font color=red This is a string with HTML logo/font; $a=strip_tags ($a); print $a; ? 2 ? $a=font color=red This is a string with HTML identifier /font; ereg_replace(^.+$, , $a); pr...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn