根据本地IP查询接口查询出经纬度与当前路径 //通过接口获取所在地址IP<br>
public function is_where(){<br>
header("content-type:text/html;charset=utf8");<br>
$content = file_get_contents("http://api.map.baidu.com/location/ip?ak=7IZ6fgGEGohCrRKUE9Rj4TSQ&ip={$getIp}&coor=bd09ll");<br>
//echo $getIp;die;<br>
$json = json_decode($content);<br>
<br>
$arr = array($json->{'content'}->{'point'}->{'x'},$json->{'content'}->{'point'}->{'y'}, $json->{'content'}->{'address'});//按层级关系提取经度数据<br>
return json_encode($arr);<br>
}<br>
AD:真正免费,域名+虚机+企业邮箱=0元