Skip to content

Instantly share code, notes, and snippets.

@gkio
Created May 25, 2017 20:23
Show Gist options
  • Save gkio/72e79b18347d1d0b00b4fb0591aab93d to your computer and use it in GitHub Desktop.
Save gkio/72e79b18347d1d0b00b4fb0591aab93d to your computer and use it in GitHub Desktop.
if($errorCode = Validator::checkName($formData['name'])){
$error[0]['name'] = $errorCode[0];
$error[1]['name'] = $errorCode[1];
}
if($errorCode = Validator::checkNumber($formData['phone'])){
$error[0]['phone'] = $errorCode[0];
$error[1]['phone'] = $errorCode[1];
}
if($errorCode = Validator::checkEmail($formData['email'])){
$error[0]['email'] = $errorCode[0];
$error[1]['email'] = $errorCode[1];
}
if($errorCode = Validator::checkTextArea($formData['note'])){
$error[0]['note'] = $errorCode[0];
$error[1]['note'] = $errorCode[1];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment