function get_gps_to_name_tx($location,$key){ $url=‘https://apis.map.qq.com/ws/geocoder/v1/?location=‘.$location.‘&key=‘.$key.‘&get_poi=1&poi_options=policy=2‘; $c= file_get_contents($url); $c=json_decode($c,1); if(isset($c[‘result‘][‘pois‘][0][‘title‘])){ return $c[‘result‘][‘pois‘][0][‘title‘]; } return ‘‘; }
原文:https://www.cnblogs.com/monxin/p/13761928.html