strip_tags-Remove HTML and PHP tags from a string, very important functions
(PHP 4, PHP 5, PHP 7)
string Strip_tags (String $str [, String $allowable _tags])
$str: Enter a string.
$allowable _tags: Optional, specifies a list of characters that are not removed.
role: Strip The HTML, XML, and PHP tags from the string.
return Value: Returns the string that was stripped.
<?php$str = ' <p><a href= "jinsanguo.com" title= "Golden three" ><b><i> I come from the Golden three countries </i></b> </a></p> '; Echo strip_tags ($STR);//Right-click the source code, output: I come from the three countries echo strip_tags ($STR, "<a>");//Right-click the source code, the output: <a href= "jinsanguo.com" title= "Golden three" > I came from the Golden three </a>echo strip_tags ($str, "<p> <b>");//Right-click on the source code, Output:<p><b> I come from </b></p>echo strip_tags ($str, "<p> <b> <a>") from the Golden Kingdoms, and/or right-click on the source code, Output: <p><a href= "jinsanguo.com" title= "Golden three" ><b> I come from the Golden three countries </b></a></p>?>
This article is from the "Golden Three" blog, please be sure to keep this source http://jinsanguo.blog.51cto.com/13363984/1972091
Example of a string filter strip_tags () function in PHP