RE: [PHP] testing an email address
| From: | Salty Marine | Date: | Fri, 12 Oct 2001 16:26:54 +0000 |
| Subject: | RE: [PHP] testing an email address | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70939@lists.php.net to get a copy of this message | ||
Greetings to You:
I need a better email validation function. I want to make sure the email
address won't return any errors.
Regards,
Salty
-----Original Message-----
From: Intruder [mailto:intruder@mail.lv]
Sent: Friday, October 12, 2001 12:09 PM
To: Joseph Bannon
Cc: PHP (E-mail)
Subject: Re: [PHP] testing an email address
JB> Is there a PHP function to test whether an email address is valid or
not?
There is no such a function as for PHP4.0 ;)))
But you can use this one
function validmail($email) {
if(eregi("^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,3}$", $email)) return
TRUE;
else return FALSE;
};
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com