strip_tags()
can strip HTML and PHP tags from a string.
PHP strip_tags() Function has the following syntax.
string strip_tags ( string html_text [, string allowed_tags] )
Its first Parameter is the string to strip. The second parameter specifies a list of HTML tags you want to keep.
PHP strip_tags() Function returns a string without HTML tags.
Here are two examples of stripping out tags:
<?PHP
$input = "<blink><strong>Hello from java2s.com!</strong></blink>";
$a = strip_tags($input);
print $a;
$b = strip_tags($input, "<strong><em>");
print $b;
?>
The code above generates the following result.