How to remove html syntax from articles_PHP tutorial

WBOY
Release: 2016-07-21 16:07:19
Original
970 people have browsed it

$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...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!