E-mail Validation

E-mail Validation

$email = 'editor@thedaily.com'
 
if (!preg_match('^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$^', $email)) {
 
echo 'The email address you entered was invalid.';
 
}