I have in my database (MySQL) text which contains links.
It's ok, if this link starts with http://mypage.com
or www.maypage.com, then I use:
But if link starts with http://www.mypage.com, then all is messed up.PHP Code:$text = ereg_replace("(http://[^[:space:]]+)", '<a href="\\1">\\1</a>', $text);
$text = ereg_replace("(www[^[:space:]]+)", '<a href="http://\\1">\\1</a>', $text);
Can anyone give me the soluton?
PS. what does it mean: [^[:space:]]+ and \\1
Thanks!







Bookmarks