Here is an example to show how to strip the HTML tags from a PHP string.

BY Best Interview Question ON 18 Aug 2020

Example

$text = '<p>Test paragraph.</p><a href="#fragment">Other text</a>';
echo strip_tags($text, '<p><a>');

Output

Test paragraph.