PHP Check Email Function

340 views
Skip to first unread message

roja...@gmail.com

unread,
Dec 27, 2007, 3:53:47 PM12/27/07
to Connecticut PHP Developers Group - CPDG
This function can be used to check for valid emails. Very simple.

---------------------------------------------------------------------------------------------


function checkEmail($email)
{
// checks for proper syntax
if( !preg_match( "/^([a-zA-Z0-9])+([a-zA-Z0-9._-])*@([a-zA-Z0-9_-])+
([a-zA-Z0-9._-]+)+$/", $email))
{
return false;
} else {
return true;
}
}//End checkEmail



--------------------------------------------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages