/**
* 判断手机号的类型
* 更新时间 2016-11-07
* @param $mobile
* @return int 1:电信 2:移动 3:联通 4:虚拟运营商 10:未知
*/
public static int getMobileType(String $mobile){
String $prefix = $mobile.substring(0, 3);
String telcomm [] = new String[]{"133","153","154","181","180","189","177"};
String mobilecomm [] = new String[]{"134","135","136","137","138","139","147","150","151","152","157","158","159","178","182","183","184","187","188"};
String unioncomm [] = new String[]{"130","131","132","155","156","185","186","145","176"};
String virtualcomm [] = new String[]{"170","177"};
if(Arrays.asList(telcomm).contains($prefix))
return 1;
else if(Arrays.asList(mobilecomm).contains($prefix))
return 2;
else if (Arrays.asList(unioncomm).contains($prefix))
return 3;
else if (Arrays.asList(virtualcomm).contains($prefix))
return 4;
else
return 10;
}
}