try this:
$str = $s24; // this is the string you want to look at...
$dst = '<a href="\\1">\\1</a>\\2';
foreach (array("http://", "mailto:", "telnet:", "news:") as $src)
{
$str = ereg_replace("(".$src."[^ ]*)( *)", $dst, $str);
}
echo $str;
-----Original Message-----
From: jtjohnston [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 2:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] http://
I'm looking for a function that will find occurences of urls in any
given string and do this:
http://www.nowhere.com/
becomes
<a href="http://www.nowhere.com/">http://www.nowhere.com/</a>
Could, should also look for
mailto:[EMAIL PROTECTED]
telnet:blah.blah
or even news:blaj.blah
Does such a thing exist?
--
John Taylor-Johnston
----------------------------------------------------------------------------
-
Coll�ge de Sherbrooke:
http://www.collegesherbrooke.qc.ca/languesmodernes/
Universit� de Sherbrooke:
http://compcanlit.ca/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php