Posted by schwooba on 01/04/07 15:35
matturbanowski "explode" option worked great. Thanks for everyone's
input.
Petr Vileta wrote:
> <schwooba@gmail.com> píse v diskusním príspevku
> news:1167921087.901015.39030@42g2000cwt.googlegroups.com...
> > Is there a simple way to remove the last part of an email address using
> > PHP. I want to remove the @ symbol and everything to the right of it.
> > Any ideas?
> >
> > Example:
> >
> > thomas@xyz.com
> >
> > should be:
> >
> > thomas
> >
> $email = preg_replace('/^(.+?)\@.+$/', '$1', $email);
> --
>
> Petr Vileta, Czech republic
> (My server rejects all messages from Yahoo and Hotmail. Send me your mail
> from another non-spammer site please.)
Navigation:
[Reply to this message]
|