function get_place_name(){
$ip=file_get_contents("http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js");
$ip=explode('=',$ip);
$ip=$ip[1];
$ip=substr($ip,0,strlen($ip)-1);
$jsonip=json_decode($ip,true);
$country=$jsonip['country'];
$province=$jsonip['province'];
$city=$jsonip['city'];
return $country.'_'.$province.'_'.$city;
}
根据新浪的API来得到当前用户所在地
最新推荐文章于 2019-01-18 16:17:20 发布