Here is a simple Function
to validate an email address in php.
function check_email($mail_address)
{
if($mail_address
== '')
{
return
false;
}
else
{
if
(preg_match("/^[0-9a-z]+(([\.\-_])[0-9a-z]+)*@[0-9a-z]+(([\.\-])[0-9a-z-]+)*\.[a-z]{2,
4}$/i", strtolower($mail_address)))
return
true;
else
return
false;
}
}
No comments:
Post a Comment