if (is_array($json_ary) || is_object($json_ary)) {
foreach ($json_ary as $id => $val) {
if (preg_match('[a-zA-Z0-9_]' , $_POST['password']))
{
$error = 'Secure enough';
return $error;
} if(strlen($_POST['password'])<8){
$error = "Password must be at least 8 characters";
return $error;
}
if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) === false) {
$error = "Invalid email address";
return $error;
}
if ($_POST['email'] == $val['email']) {
$emailFound = TRUE;
$error = 'Email already in use';
break;
}
}