Forum Moderators: coopster
$comment = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0\">\\0</a>",$comment);
this code turns
hxxp://www.etc.com
<a href="http://www.etc.com">http://www.etc.com</a>
but I'd like to turn
<a href="http://www.etc.com">http://www.etc.com</a>
into
hxxp://www.etc.com
N.B. hxxp = http (i had to use this notation as the forum turns the exmaple into a link otherwise)
any suggestions? I guess I don't really understand the \\0's nor the [[:alpha:]], [[:space:]] symbols, so if someone could explain them better than the PHP manual, I'd be very grateful.