note 111051 modified in function.filter-var by danbrown
| From: | danbrown@php.net | Date: | Thu, 17 Jan 2013 15:17:13 +0000 |
| Subject: | note 111051 modified in function.filter-var by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193167@lists.php.net to get a copy of this message | ||
Keep in mind that FILTER_VALIDATE_EMAIL will validate the email address according to standards.
However, giving the fact that organizations are free to restrict the forms of their own email
addresses, using ONLY this filter can you a lot of bounces.
gmail, yahoo, hotmail, aol have special rules
For example :
<?php
$email_a = '0hot\'mail_check@hotmail.com';
if (filter_var($email_a, FILTER_VALIDATE_EMAIL)) {
echo "This (email_a) email address is considered valid.";
//reported as valid
}
//there can be no "0hotmail_check@hotmail.com"
//because hotmail will say "Your email address needs to start with a letter. Please try
again." even if you remove the '
?>
--was--
Keep in mind that FILTER_VALIDATE_EMAIL will validate the email address according to standards.
However, giving the fact that organizations are free to restrict the forms of their own email
addresses, using ONLY this filter can you a lot of bounces.
gmail, yahoo, hotmail, aol have special rules
For example :
<?php
$email_a = '0hot\'mail_check@hotmail.com';
if (filter_var($email_a, FILTER_VALIDATE_EMAIL)) {
echo "This (email_a) email address is considered valid.";
//reported as valid
}
//there can be no "0hotmail_check@hotmail.com"
//because hotmail will say "Your email address needs to start with a letter. Please try
again." even if you remove the '
http://php.net/manual/en/function.filter-var.php