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