Jump to content

Convert <a href="url">Anchor</a> into 'Anchor'


johnsmith153

Recommended Posts

I have a string of text and I need to remove the hyperlink.

 

So:

 

$text = 'Hello <a href="url">Click HERE</a>';

 

needs to output 'Hello Click HERE'

 

This sounds simple, but I can't do it. I could easily do it the other way round.

 

I won't know the anchor text though, it could be anything.

Link to comment
https://forums.phpfreaks.com/topic/264168-convert-anchor-into-anchor/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.