1$text = "<a href='http://www.google.com/'>Google1</a><br>" .
2 "<a>Google2</a><br>" .
3 "<afaketag href='http://www.google.com'>Google2</afaketag><br>" .
4 "<afaketag>Google4</afaketag><br>" .
5 "<a href='http://www.google.com'><img src='someimage.jpg'></a>";
6echo preg_replace("/<\/?a( [^>]*)?>/i", "", $text);