我这里用的淘宝的接口,很好用。
http://ip.taobao.com/service/getIpInfo.php?ip=$ip
通过接口显示当前ip地址的国家和省份
$ip直接GET调取就可以。
推荐