I am unable to write the exact pattern for mobile number (as 0(555) 222 11 11 format) in PHP .
My function
function isPhone($phone){
if(preg_match("/^[0-9]{3}-[0-9]{4}-[0-9]{4}$/", $phone)) {
return true;
}else{
return false;
}
}
Aucun commentaire:
Enregistrer un commentaire