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