I'm trying to validate phone numbers and am struggling with this code. When I input a mobile number(0-9) with a length of either 10 or 11 I get invalid mobile number. Any ideas?
if (!preg_match('[0-9]{10,11}', $mobileNumber)) {
echo("invalid mobile number");
exit();
}