Removes html and PHP tags from a string.
This function returns a string with the html and PHP tags removed from the input string. The optional exempt_tags parameter can be used to specify tags that should not be removed from the string.
<?php
$s = "This <b>is</b> a <i>string</i> with <font color=\"blue\">some</font> tags.";
$s = strip_tags($s, "<i>");
print htmlspecialchars($s);
?>
This is a <i>string</i> with some tags.
A string with a few different kinds of tags is stripped of all tags except the italics tag. The result is printed with htmlspecialchars() in order avoid interpretation of the tags.