これは私が実行しようとしている単純なコードですが、データを出力しません。誰か助けてもらえますか?ありがとう!!
<?php
$addr = "Hotels in ottawa canada";
$a = urlencode($addr);
$geocodeURL =
"https://maps.googleapis.com/maps/api/geocode/json?address=$a&sensor=false&key=my key";
$ch = curl_multi_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_multi_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$geocode = json_decode($result);
$lat = $geocode->results[$i]->geometry->location->lat;
$lng = $geocode->results[$i]->geometry->location->lng;
echo $formatted_address = $geocode->results[$i]->formatted_address;
echo $geo_status = $geocode->status;
echo $location_type = $geocode->results[0]->geometry->location_type;
echo $location_type = $geocode->results[$i]->geometry->premise;
echo $street_address = $geocode->results[$i]->street_address;
?>