How can I use preg_replace to remove the links from a string, but still keep the anchor text? <a href="blabla">I want to keep this text</a> <a target="blabla" href="blabla">I want to keep this text</a>
preg_replace("/\<a(.*)\>(.*)\<\/a\>/iU", "$2", $string); or preg_replace("/\<a([^>]*)\>([^<]*)\<\/a\>/i", "$2", $string); PHP: i think that should work
Yep. Very nice I worked it out, but your solution is far more elegant than the crap I was using. +REP