Published in: PHP
function is_valid_email( $email ) { } 'fred_dred@aol.com', 'fred-dred@aol.com', 'fred.dred@aol.com', 'fred+dred@aol.com' ); foreach( $emails as $email ) { }
Comments
Subscribe to comments
You need to login to post a comment.

See http://www.ilovejackdaniels.com/php/email-address-validation/ for the proper way to do RFC 2822 validation.
The above code doesn't work. It lets through the following invalid email addresses:
Also, your regex is limiting the use of many other ASCII characters that RFC-2822 allows in an email address.