Maison  >  Article  >  php教程  >  一些可以查询IP地理位置、身份证所在地、手机归属地的接口

一些可以查询IP地理位置、身份证所在地、手机归属地的接口

PHP中文网
PHP中文网original
2016-05-25 17:05:481523parcourir

php代码

<?php
/*
新浪的IP查询接口:
新浪的:http://counter.sina.com.cn/ip?ip=IP地址
返回Js数据,感觉不是很精确,可以把问号后面的去掉,直接返回本机对应的IP所在地

有道的IP查询接口:
返回XML数据:http://www.yodao.com/smartresult-xml/search.s?type=ip&q=0.0.0.0返回JSON数据:http://www.yodao.com/smartresult-xml/search.s?jsFlag=true&type=ip&q=0.0.0.0把0.0.0.0换成需查询的IP地址即可,这个应该是用纯真的数据库

太平洋电脑网IP查询接口:http://whois.pconline.com.cn/?ip=0.0.0.0把0.0.0.0换成IP地址,页面上还有其他无关内容,这些内容是告诉我们哪些接口可以调用、接口调用参数和使用方法等

查询手机号码归属地接口:
返回XML数据:http://www.youdao.com/smartresult-xml/search.s?type=mobile&q=13888880000返回JSON数据:http://www.youdao.com/smartresult-xml/search.s?jsFlag=true&type=mobile&q=13888880000身份证查询接口:
返回XML数据:http://www.youdao.com/smartresult-xml/search.s?type=id&q=身份证号
返回JSON数据:http://www.youdao.com/smartresult-xml/search.s?jsFlag=true&type=id&q=身份证号
*/
echo file_get_contents("接口网址和参数");
?>
Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Article précédent: PHP aes算法Article suivant:PHP实现数字格式化,每三位加逗号