搜索附近补胎服务电话 (搜索附近补胎电话)
长沙休闲
04-13
阅读:41
评论:0
status != 'OK') {echo '
无效的地址。请重试。
';} else {// 获取经纬度坐标$latitude = $geocode->results[0]->geometry->location->lat;$longitude = $geocode->results[0]->geometry->location->lng;// 搜索附近的补胎服务$url = 'https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=' . $latitude . ',' . $longitude . '&radius=5000&type=tire_repair&key=YOUR_API_KEY';$response = file_get_contents($url);$response = json_decode($response);// 如果没有找到补胎服务,则显示错误消息if ($response->status != 'OK') {echo '未找到补胎服务。请重试。
';} else {// 显示补胎服务的名称和电话号码echo '附近的补胎服务:
';echo '-
';foreach ($response->results as $result) {echo '
- ' . $result->name. ' - ' . $result->formatted_phone_number . ' ';}echo '
版权声明
本文仅代表作者观点,不代表长沙桑拿立场。
本文系作者授权发表,未经许可,不得转载。