Email verify function

This is an email verification function using regular expressions

function checkEmail($address)
{
if(ereg( “^[^@ ]+@([a-zA-Z0-9\-]+\.)+([a-zA-Z0-9\-]{2}|net|com|gov|mil|org|edu|int)$”,$address) )
return true;
else
return false;
}

usage

checkEmail(testemail@testemail.com);

LEAVE A REPLY

Please enter your comment!
Please enter your name here

*