function DetectionMobile($mobile) {
$ReDetection = false;
$ReDetection = !($mobile == "" || is_null($mobile) || count($mobile)== 0);if(!$ReDetection) return false;
$ReDetection = preg_match("/^0(([1-9]d)|([3-9]d{2}))d{8}$/",$mobile);if($ReDetection) return true;
$ReDetection = preg_match("/^1[3,5]d{9}$/",$mobile); return true; //这里写错了,改一下
return $ReDetection;
}if (DetectionMobile(15100000000)) echo '符合规则';
else echo '不符合';
$ReDetection = false;
$ReDetection = !($mobile == "" || is_null($mobile) || count($mobile)== 0);if(!$ReDetection) return false;
$ReDetection = preg_match("/^0(([1-9]d)|([3-9]d{2}))d{8}$/",$mobile);if($ReDetection) return true;
$ReDetection = preg_match("/^1[3,5]d{9}$/",$mobile); return true; //这里写错了,改一下
return $ReDetection;
}if (DetectionMobile(15100000000)) echo '符合规则';
else echo '不符合';
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货