> -----Original Message-----
> From: Robert Reed [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, May 17, 2001 10:36 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] plain text email address to hyperlink?
> 
> 
>     I've attempted to use the following snippet to convert an 
> email address in plain text to a hyperlink, and while it 
> works fine in a function to verify an email address, it 
> doesn't seem to work to replace all occurances of an email 
> address within a body of text.
> 
> 
> $page = 
> eregi_replace("^[0-9a-z]+([-_./]([0-9a-z]+))*@[0-9a-z]+([-.]([
> 0-9a-z]+))*\\.
> [a-z]{2,4}$","<a href=\"\\1\">\\1</a>",$pageOne);
> 
> echo $page;
> 
> 
> $pageOne is the body of text that has the email address(es) 
> in it.  Is there a better way of doing this, or would I have 
> to bend and use an array to scan each word for an email 
> address and then convert them from there?
> 
> Thanks in advance,

You can find the code here:
http://www.newbienetwork.net/phpcodems.php?as=viewcode&id=6

Enjoy.

Jason Lotito
www.Newbienetwork.net


-- 
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