You can remove HTML and PHP tags with
<?php
$text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
echo strip_tags($text);
echo "
";
// Allow <p> and <a>
echo strip_tags($text, '<p><a>');
?>
result:
Test paragraph. Other text
<p>Test paragraph.</p> <a href="#fragment">Other text</a>
source: https://www.php.net/manual/pt_BR/function.strip-tags.php
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…