hi, i'm having the following problem: i'm having a code snippit that searches a text for links and makes them clickable...
i'm using the following:
$entry_comment = ereg_replace("http://(([A-Za-z0-9.-])*)([a-zA-Z0-9])", "<a href=\"\0\" target=\"_blank\">\0</a>",$entry_comment);
now, the problem is that it works very well with a http://www.whatever.com address
but it fails on links like:
http://www.geocities.com/test
where it will output:
<a href="http://www.geocities.com" target="_blank">http://www.geocities.com</a>/test
now, i can only find other pieces of code that do the same like mine (failing on links with a directory included), but i can't find code that does that second example well too...
so if anyone can help me changing my piece of code, or has another snippit that would work well...that would be great...
thanks in advance,
bert