Validate Email Addresses Using PHP
by satheeshkumar[ Edit ] 2012-08-17 22:43:09
Validate Email Addresses Using PHP
//$email = "abc123@lolhaha"; // Invalid email address
$email = "somebody@somesite.com"; // Valid email address
$regex = '/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([comco.in])+$/';
if (preg_match($regex, $email))
{
echo "Email is valid";
}
else
{
echo "invalid email";
}
?>