PHP Strip HTML tags except the given – PHP March 19, 2011 Pramod T P Leave a comment <?php $text = '<p>TestP</p><b>Tesb</b> <a href="">TestA</a>'; echo strip_tags($text); //Strip all tags echo strip_tags($text, '<p><a>'); //Strip all tags except p and a ?>