``` ~~~ public function test(){ $ip=$_SERVER['REMOTE_ADDR']; $data_info=file_get_contents("http://api.map.baidu.com/location/ip?ip={$ip}&ak=key&coor=bd09ll"); $data_info = json_decode($data_info,true); //数据转换 echo '<pre>'; print_r($data_info); echo '</pre>'; } ~~~ ```