By using 'eregi' we can validate our email address.For validate email we use a pattern and match our email address with this pattern
function isValidEmail($email_address)
{
$emailpattern = "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$";
if (eregi($emailpattern, $email_address))
return true;
else
return false;
}
isValidEmail('xyz@gmail.com');
0 Comment(s)