"Michael Geier" <[EMAIL PROTECTED]> wrote:

> What I need to find is all the urls in the document and make hrefs out of
> them.
> 
> ie:
>         http://www.mysite.com becomes &lt;a
> href="http://www.mysite.com"&gt;http://www.mysite.com&lt;/a&gt;
> 
> any ideas?  TIA!

I use this code in my PHPost project:

   $s = ereg_replace("([[:alpha:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])",
           "<a href=\"\\1://\\2\\3\" target=\"_blank\">\\0</a>", $s );

Mark


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to