Re: How do i valadate an email address?
| From: | AzFLSite | Date: | Thu, 27 Mar 2003 09:07:04 +0000 |
| Subject: | Re: How do i valadate an email address? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-141188@lists.php.net to get a copy of this message | ||
I keep forgetting to do the reply to all thing! :)
Here it is for anyone else as well.
if
(!eregi('^[a-z0-9._-]+@[a-z0-9]+\.[a-z]{2,5}$',$email))
{
echo 'Invalid email address';
} else {
//do whatever
}
That should do it. Sometimes I get these wrong off
the top of my head.
Silly
>--- "Philip J. Newman" <newmanpj@philipnz.com>
> wrote:
> > How would i check that an e-mail has the right
> parts
> > in it. for example.
> >
> > username @ domain . ext
> >
> > Thanks
> >
> > / Jim Bob
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
> >
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Platinum - Watch CBS' NCAA March Madness,
> live on your desktop!
> http://platinum.yahoo.com
>
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com