strip_tags

strip_tags (PHP 4, PHP 5) strip_tags — Strip HTML and PHP tags from a string Description string strip_tags ( string $str [, string $allowable_tags ] ) Parameters str : The input string. allowable_tags :  You can use the optional second parameter to specify tags which should not be stripped. Note: HTML comments and PHP tags are also stripped. This is hardcoded and can not be changed with allowable_tags. Return Values Returns the stripped string. Example #1 strip_tags() example <?php $text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>'; echo strip_tags($text); echo "\n"; // Allow <p> and <a> echo strip_tags($text, '<p><a>'); ?> The above example will output: Test paragraph. Other text <p>Test paragraph.</p> <a href="#fragment">Other text</a>...

Read More
'