How to remove HTML tags from a string using PHP?
Here is an example to show how to strip the HTML tags from a PHP string.
Example
$text = '<p>Test paragraph.</p><a href="#fragment">Other text</a>';
echo strip_tags($text, '<p><a>');
Output
Test paragraph.