Rather than trying to validate them manually which is really really hard to get working on
every email address going, why not use one of the inbuilt filter functions, eg:
$email = "
this@example.com";
if (filter_var($email_a, FILTER_VALIDATE_EMAIL)) {
echo "This (email_a) email address is considered valid.";
}
The trouble with email addresses is there are so many variations allowed under the RFC's
including lots of character that you might not think of as legit such as "+" that
any validation script almost always breaks.
This example and such comes from:
http://uk2.php.net/manual/en/book.filter.php...although you need PHP 5.2.x and I only found out about them by accident about a month ago.