摘自:
http://www.oschina.net/code/snippet_1030827_21294 <?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("接口網址和參數");
?>
posted on 2013-05-14 12:10
一凡 閱讀(827)
評論(1) 編輯 收藏 所屬分類:
OpenSource