Test if email_validate function exists and fix change the indentation from spaces to tabs.

This commit is contained in:
markjcrane
2015-12-20 22:36:34 -07:00
parent fd761f7432
commit 93dd62c363

View File

@@ -1326,17 +1326,19 @@ 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 (!function_exists('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;
}
}
if (count($matches) == 0) {
return 0;
}
else {
return 1;
}
}
}
?>