Forum Moderators: coopster
Is there a simple function or class to remove hyperlinks but retain the link text or image?
I considered stripping out all html with a regex but I'd like to leave tables, images etc.
I just want to delink hyperlinks.
EDIT:
It looks like I could replace "href" with something like "xhref" to create invalid html, which will work in my case
$pattern = "/href=['\"\s]?[^\s>]*[\s>]/i";
$string = preg_replace($pattern, '', $string);