The email_validate is a generic function so moving it to resources/functions.php.
This commit is contained in:
parent
73b9f61290
commit
1ed020ceda
|
|
@ -1314,4 +1314,18 @@ function number_pad($number,$n) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//email validate
|
||||||
|
function email_validate($strEmail){
|
||||||
|
$validRegExp = '/^[a-zA-Z0-9\._-]+@[a-zA-Z0-9\._-]+\.[a-zA-Z]{2,3}$/';
|
||||||
|
// search email text for regular exp matches
|
||||||
|
preg_match($validRegExp, $strEmail, $matches, PREG_OFFSET_CAPTURE);
|
||||||
|
|
||||||
|
if (count($matches) == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Loading…
Reference in New Issue