首页 > Windows开发 > 详细

【PHP】]淘宝来源IP=》地区 API调用

时间:2014-03-21 19:02:00      阅读:734      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
$ch = curl_init(); 
$url = "http://ip.taobao.com/service/getIpInfo.php?ip=202.102.3.141";    //测试202.102.3.141 江苏省常州市
curl_setopt ($ch, CURLOPT_URL, $url); 
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT,10); 

$sourceInfo = json_decode(curl_exec($ch)); 
bubuko.com,布布扣

$sourceInfo:

bubuko.com,布布扣
/**
* 淘宝显IP API返回数据:
* @var [country] => 中国
[country_id] => CN
[area] => 华东
[area_id] => 300000
[region] => 江苏省
[region_id] => 320000
[city] => 常州市
[city_id] => 320400
[county] => 
[county_id] => -1
[isp] => 电信
[isp_id] => 100017
[ip] => 202.102.3.141
* 
*/
bubuko.com,布布扣

【PHP】]淘宝来源IP=》地区 API调用,布布扣,bubuko.com

【PHP】]淘宝来源IP=》地区 API调用

原文:http://www.cnblogs.com/vmax/p/3616163.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!