note 57039 deleted from function.strstr by mazzanet
| From: | mazzanet@php.net | Date: | Thu, 22 Sep 2005 07:37:12 +0000 |
| Subject: | note 57039 deleted from function.strstr by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-95587@lists.php.net to get a copy of this message | ||
Note Submitter: jensen [DOT] somers [AT] gmail [DOT] com
----
As a note to josejayesh [dot] gmail.com
The best way to validate an email is by using an ereg expression. It's much faster and allows
more.
<?php
function checkEmail($adressr) {
return ereg("^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]
{1,3}\.)¦(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}¦[0-9]{1,3})(\]?)$", $adress);
// even alows adresses like me@10.0.0.0
}
?>