I'm trying to process a string and replace url names that start with string:
www.
http://
WWW.
HTTP://
with links to sites with that url. For exaple:
This is a simple string www.phpbuilder.com is a great site...
this link should be raplaced with sth like this:
This is a simple string <a href="www.php.builder.com">www.phpbuilder.com</a> is a great site...
but how to get only link (they have different lenths etc)
CAN YOU HELP ME.....
below is a function I think I should use... but it needs modifications
function url($message)
{
$message = str_replace("http://XXXXXX.XXX", "<a href=\"XXXXXX.XXX\">XXXXXX.XXX</a>", $message);
$message = str_replace("www.XXXXXX.XXX", "<a href=\"XXXXXX.XXX\">XXXXXX.XXX</a>", $message);
return($message);
}