批量在线查询手机号码归属地信息,淘宝接口,实时更新。外行作品
此程序可以在本地php环境下批量查询手机号码归属地信息,利用淘宝的接口,可以适时支持最新的号码段。使用时请把需要批量扫描的号码按每条一行的格式放在一个tel.txt文本中,把下面代码保存到一个php文件中,即可使用。 写这个程序的初衷是为公司外呼团队服务
此程序可以在本地php环境下批量查询手机号码归属地信息,利用淘宝的接口,可以适时支持最新的号码段。使用时请把需要批量扫描的号码按每条一行的格式放在一个"tel.txt"文本中,把下面代码保存到一个php文件中,即可使用。
写这个程序的初衷是为公司外呼团队服务的,可以把查询到的手机归属地信息按北京、上海、外省等分类出来。按此需求也做了一个VB版的客户端程序,可以批量导入,单条、批量查询手机号码归属地信息。需要客户端软件的朋友可以联系我,免费赠予。
作为一个php的外行,此代码写的有些简单,希望大牛能修改一下,做成WEB端的,可以上传文件、批量在线查询的程序。修改好的话请告之大家,谢谢!
<?php $handle = fopen("tel.txt", "r"); if ($handle) { //打开要写入的文件对象 while (!feof($handle)) { $buffer = fgets($handle, 4096); $content = get_mobile_area(trim($buffer)); echo "手机号: ".$buffer." 归属地: ".$content.'<br/>'; if(strpos($content,'北京') !== false){ $file=fopen("北京.txt","a+"); fwrite($file,trim($buffer)." ".$content."\n"); fclose($file); }else if(strpos($content,'上海') !== false){ $file1=fopen("上海.txt","a+"); fwrite($file1,trim($buffer)." ".$content."\n"); fclose($file1); }else{ $file2=fopen("外省.txt","a+"); fwrite($file2,trim($buffer)." ".$content."\n"); fclose($file2); } } fclose($handle); } function get_mobile_area($mobile){ if($mobile!=''){ $sms = array('province'=>'', 'supplier'=>''); //初始化变量 //根据淘宝的数据库调用返回值 $url = "http://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=".$mobile."&t=".time(); $contents = file_get_contents($url); $sms['province'] = substr($contents, "56", "4"); //截取字符串 $sms['supplier'] = substr($contents, "81", "4"); return $sms['province']." ".$sms['supplier']; } } ?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver CS6
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
