Home >Backend Development >PHP Tutorial >Collection Exercise (9) PHP Obtaining the Attribution of Mobile Phone Number_PHP Tutorial

Collection Exercise (9) PHP Obtaining the Attribution of Mobile Phone Number_PHP Tutorial

WBOY
WBOYOriginal
2016-07-20 11:14:12881browse

I saw a friend asking for in the group this afternoon, so I took a look. It is found that the mobile phone number location query is basically provided by . All major websites have used the interface of this company, so I also wanted to see how to get the information I need. There is no free interface for mobile phones online. To check the location of the mobile phone, I can only send a request to its website page ......This method is meaningless.

So I continued to search, and still found the solution on the touch screen version of the mobile phone online (m.showji.com) (thanks to mobile Internet).

has an api interface that can directly obtain mobile phone number location information. The red one is .... . Displayed below

http://api.showji.com/Locating/www.showji.com.aspx?m=&output=json&callback=querycallback

:.

When using it, you can remove the following Otherwise, it needs to be intercepted and processed.

header("content-type:text/html;charset=utf-8");
$url = "http://api.showji.com/Locating/www.showji.com.aspx";
$cellPhoneNumber = "13530552275";
$setting_array = array(
	'http' => array(
	            'timeout' => 5,
	            'method' => 'GET',
	            'protocol_version'=>'1.1',
	            'header' =>
                     "User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7\r\n" .
                     "Host: api.showji.com\r\n" .
                     "Accept-Language: zh-cn,zh;q=0.8\r\n" .               
                     "Accept: */*\r\n" .
                     "Referer:http://m.showji.com/\r\n" .
                     "Connection: keep-alive\r\n\r\n"
	         )
);
$headers = stream_context_create($setting_array);
//$jsons = file_get_contents($url."?m=".$cellPhoneNumber."&output=json",FALSE,$headers); //这样打开要10s
$jsons = file_get_contents($url."?m=".$cellPhoneNumber."&output=json");// 直接打开1s不到
$cellPhoneInfo = json_decode($jsons,true);
print_r($cellPhoneInfo);
//360的接口
echo file_get_contents("http://apps.qiyigoo.com/telsearch/get_tel.php?_=1370366237601&do=get_tel_info&teltype=phone&phone=13530552275&1370366237599");

Of course also has an interface, but the information returned is a bit less, it only returns city and card information.

The red one is and the blue one is You have to replace it yourself when requesting. .

http://apps.qiyigoo.com/telsearch/get_tel.php?_=&do=get_tel_info&teltype=phone&phone=&

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/440317.htmlTechArticleI saw a friend asking for it in the group in the afternoon, so I took a look. The query for finding the location of the mobile phone number is basically provided by . All major websites have adopted the interface of this company, so I...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn