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.

Suggest An Answer

Our Particitants

Strip_tags() is function to remove HTML tag in the string