多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
~~~ public static function ip() { $ip='220.197.208.157'; // $ip=Request::ip(); //thinkphp获取ip $type='json';//数据返回方式xml json $key='你的key';//高德地图web服务key //[https://lbs.amap.com/api/ios-track/summary/](https://lbs.amap.com/api/ios-track/summary/) $url='https://restapi.amap.com/v3/ip?ip='.$ip.'&output='.$type.'&key='.$key; $result = file_get_contents($url); $result = json_decode($result,true); return $result['province'].$result['city']; } ~~~