function validate_mobile($mobile) { return preg_match('/^[6-9]d{9}$/', $mobile); } if(validate_mobile(6428232817)){ echo "Yes"; }else{ echo "No"; }