Identify mobile number operator

From , 3 Years ago, written in PHP, viewed 87 times.
URL https://pastebin.vip/view/14491b75
  1. /**
  2.     * 返回类型  
  3.       1 中国移动
  4.       2 中国联通
  5.       3 中国电信
  6.       0 无法识别
  7.     **/  
  8.      
  9.     function validate(phoneno){  
  10.          
  11.         var regex = /^(134|135|136|137|138|139|150|151|157|158|159)[0-9]{8}$/;  
  12.         if(regex.test(phoneno)){  
  13.             alert("中国移动!");  
  14.             return 1;  
  15.         }  
  16.         regex = /^(130|131|132|155|156)[0-9]{8}$/;  
  17.         if(regex.test(phoneno)){  
  18.             alert("中国联通!");  
  19.             return 2;  
  20.         }  
  21.         regex = /^(133|153|189)[0-9]{8}$/;  
  22.         if(regex.test(phoneno)){  
  23.             alert("中国电信!");  
  24.             return 3;  
  25.         }  
  26.        regex = /^(170)[0-9]{8}$/;  
  27.         if(regex.test(phoneno)){  
  28.             alert("虚拟运营商!");  
  29.             return 3;  
  30.         }  
  31.         return 0;  
  32.     }  
  33.  
  34. 中国移动:134135136137138139150151152157(TD)158159182183184187188147(数据卡)
  35. 中国联通:130131132152155156185186
  36. 中国电信:133153180181189

Reply to "Identify mobile number operator"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website