RFC6530 - Check if variable contains a well-formatted e-mail address in PHP

13

Recently adopted by Gmail as published in Official Gmail Blog , and as defined in RFC 6530 :

Assuming a valida_email() function that would return Boolean:

echo valida_email("té[email protected]");   // devolve TRUE
echo valida_email("香蕉@例子.cn");       // devolve TRUE
                   └────┬────┘
                        │
 /*   (supostamente escrevi [email protected]) */

Question

In PHP, how can we validate if the contents of a variable is a well-formatted e-mail address as defined in RFC 6530?

Note: It does not matter if it exists or does not exist, it matters that it is a valid email address under the existing rules that define the formatting, see RFC 6530 .

    
asked by anonymous 08.11.2014 / 01:48