最完整的php验证手机号码:
移动:134、135、136、137、138、139、150、151、152、157、158、159、182、183、184、187、188、178(4G)、147(上网卡);
联通:130、131、132、155、156、185、186、176(4G)、145(上网卡);
电信:133、153、180、181、189 、177(4G);
卫星通信:1349
虚拟运营商:170
function checkPhoneNumber($phone_number){
//@2017-11-25 14:25:45 https://zhidao.baidu.com/question/1822455991691849548.html
//中国联通号码:130、131、132、145(无线上网卡)、155、156、185(iPhone5上市后开放)、186、176(4G号段)、175(2015年9月10日正式启用,暂只对北京、上海和广东投放办理),166,146
//中国移动号码:134、135、136、137、138、139、147(无线上网卡)、148、150、151、152、157、158、159、178、182、183、184、187、188、198
//中国电信号码:133、153、180、181、189、177、173、149、199
$g = "/^1[34578]\d{9}$/";
$g2 = "/^19[89]\d{8}$/";
$g3 = "/^166\d{8}$/";
if(preg_match($g, $phone_number)){
return true;
}else if(preg_match($g2, $phone_number)){
return true;
}else if(preg_match($g3, $phone_number)){
return true;
}
return false;