Using strip_tags() function.
Definition and Usage
The strip_tags() function strips a string from HTML, XML, and PHP tags.
Syntax
[PHP]strip_tags(string,allow)[/PHP]
Explanation
Tips and Notes
Note: HTML comments are always stripped. This cannot be changed with the allow parameter.
Example 1
[PHP]<?php
echo strip_tags("Hello <b>world!</b>");
?>[/PHP]
The output of the code above will be:
[hr]
Example 2
[PHP]<?php
echo strip_tags("Hello <b><i>world!</i></b>","<b>");
?>[/PHP]
The output of the code above will be: