HTML tag strip
<?php $input = "This <a href='http://www.java2s.com/'>java2s</a> is <b> </b>!"; echo strip_tags($input, "<a>"); ?>