Question : php remove anchor tag from string
Answered by : geeky-bravo
$text = "<a href='http://www.google.com/'>Google1</a><br>" . "<a>Google2</a><br>" . "<afaketag href='http://www.google.com'>Google2</afaketag><br>" . "<afaketag>Google4</afaketag><br>" . "<a href='http://www.google.com'><img src='someimage.jpg'></a>";
echo preg_replace("/<\/?a( [^>]*)?>/i", "", $text);
Source : https://stackoverflow.com/questions/5870201/remove-anchors-from-text | Last Update : Wed, 01 Jul 20