Я использую PHP 5.3.10. Это код:
<?php
$email = "[email protected]";
if (filter_var($email, FILTER_VALIDATE_EMAIL))
echo "Email: ".$email." correct";
else
echo "email not correct";
?>
Он возвращает: "Email: [email protected]
правильный.
Я думаю, что домен верхнего уровня с одним символом неверен (я не знаю о TLD с одним символом в соответствии с этим списком: http://data.iana.org/TLD/tlds-alpha-by-domain.txt
).
Итак, фильтр FILTER_VALIDATE_EMAIL
работает правильно или нет?