Re: how to seek and convert an email address to mailto link
| From: | RIVES Sergio | Date: | Tue, 19 Mar 2002 16:28:39 +0000 |
| Subject: | Re: how to seek and convert an email address to mailto link | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-89158@lists.php.net to get a copy of this message | ||
Hi,
I think the following lines could help you :
$line = "Foobar foobar foo@foo.com foobar foobar";
list($var1,$var2,$var3,$var4,$var5) = explode(" ",$line);
echo "$var1 $var2 <a href="mailto:$var3">$var3</a>." ".$var4."
".$var5";
more or less... i am a newbie in this stuff...
hope it helps you
SR
Pekka Saarinen a écrit :
> Hi,
>
> I need to search text for @ and replace the mail address around it (i.e.
> text between previous and following spaces) so that if I have text
>
> Foobar foobar foo@foo.com foobar foobar.
>
> It'll convert it to
>
> Foobar foobar <a
> href="mailto:foo@foo.com">foo@foo.com</a> foobar
> foobar.
>
> Anyone?
>
> Thanks,
>
> Pekka
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php