Re: Verifying EMail-Address

From: Date: Tue, 08 Aug 2000 16:04:48 +0000
Subject: Re: Verifying EMail-Address
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-10720@lists.php.net to get a copy of this message
At 17:44 8-8-00 +0200, Martin Thoma wrote:
Hello ! Does anybody know a small piece of script then can verify, if an email-address is correct/has correct syntax ? Something the checks if there is an @ and a top-level-domain and so on... Regards
Hiya here you go function Validate_Email ($email) {
                return (preg_match("'^[a-z0-9_.=-]+@([a-z0-9-]+\.)+([a-z]{2,3})\$'i", $email));
} Greetz, Wico
Martin -- 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


« previous php.general (#10720) next »