Strip anchors down to their contents, only if the anchor's URL contains...
- by Tony
Hi,
Does anyone know a regex function in PHP to strip an anchor of it's contents, only if the anchor's href attribute contains specific text?
For example, I have an HTML page and there are links throughout. But I want to strip only the anchors that contain "yahoo" in the URL. So <a href="http://pages.yahoo.com/page1">Example page</a> would become: Example, while other anchors in the HTML not containing "yahoo" would be left alone.
Thank you in advance.
-T