Skip to content

Instantly share code, notes, and snippets.

@luismr
Created June 6, 2014 02:45
Show Gist options
  • Save luismr/75004e880c7736552b8f to your computer and use it in GitHub Desktop.
Save luismr/75004e880c7736552b8f to your computer and use it in GitHub Desktop.
/* fiz esta alteração para validar somente os números já valendo a regra de 2013 da ANATEL para o 9 digito */
private function validateMobilePhoneNumber($phone) {
$exp_regular = '/^(0[1-2][1-9]9\d{8})|(0[3-9][1-9]\d{8})$/';
$ret = preg_match($exp_regular, $phone);
if($ret === 1) {
return TRUE;
} else {
return FALSE;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment