PHP Filters The intrinsic functions of HTML tags. PHP Filter HTML functions: Strip_tags (stringso you can filter out all the HTML tags. If you want to filter out"">HTML tags outside of the strip_tags, you can write:string,""); filter except""><p>xxx</p><b></b>HTML tags outside of the strip_tags, you can write:string,"<p><b>");
htmlentities***************************************************************
html_entity_decode*********************************************************
<?Php$orig="I ' ll \ "Walk\" The <b>dog</b> now"; $a=htmlentities ($orig); $b=Html_entity_decode ($a); Echo $a; //I ' ll "walk" the <b>dog</b> nowEcho $b; //I ' ll "walk" the <b>dog</b> now? >*************htmlspecialchars****************************************************<?php$New= Htmlspecialchars ("<a href= ' test ' >Test</a>", ent_quotes);
echo $New;//<a href=& #039;test& #039;> Test</a>? >******htmlspecialchars_decode****************************************************<?Php$str="<p>this-> "</p>\n"; Echo Htmlspecialchars_decode ($STR);//Note that the quotes here are not convertedEcho Htmlspecialchars_decode ($str, ent_noquotes);?>The above routines will output:<p> This-"</p>
<p> This"</p>
PHP filtering and character conversion functions