Google maps api 3 谷歌地理编码API返回空值

Google maps api 3 谷歌地理编码API返回空值,google-maps-api-3,php-curl,Google Maps Api 3,Php Curl,我已经在SO和其他网站上查看了一些答案,并尝试了所有的组合,包括不安全的组合(见下文),但没有任何效果。这是我的密码: while($row = $stmt->fetch()) { $GoogleRequest = "https://maps.googleapis.com/maps/api/geocode/json?address="; $GoogleRequest .= $row["Address"] . ", "

我已经在SO和其他网站上查看了一些答案,并尝试了所有的组合,包括不安全的组合(见下文),但没有任何效果。这是我的密码:

while($row = $stmt->fetch()) {
    $GoogleRequest = "https://maps.googleapis.com/maps/api/geocode/json?address=";
    $GoogleRequest .= $row["Address"] . ", ";
    $GoogleRequest .= $row["City"] . ", ";
    $GoogleRequest .= $row["State"] . ", ";
    $GoogleRequest .= $row["PinCode"] . ",IN";
    $GoogleRequest = urlencode($GoogleRequest) . "&key=" . $APIKey;
    $curl = curl_init($GoogleRequest);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($curl, CURLOPT_HEADER, false);
    // curl_setopt($curl, CURLOPT_HTTPGET,true);
    $curl_response = json_decode(curl_exec($curl), true);
    echo "<br>curl_response Status:->" . $curl_response['status'] . "<-";
    curl_close($curl);
    var_dump($curl_response);
    var_dump($curl_response['results'][0]['geometry']['location']['lat']);
    var_dump($curl_response['results'][0]['geometry']['location']['lng']);
}
while($row=$stmt->fetch()){
$GoogleRequest=”https://maps.googleapis.com/maps/api/geocode/json?address=";
$GoogleRequest.=$row[“Address”]。“,”;
$GoogleRequest.=$row[“城市”];
$GoogleRequest.=$row[“State”]。“,”;
$GoogleRequest.=$row[“PinCode”]。“,IN”;
$GoogleRequest=urlencode($GoogleRequest)。“&key=”.$APIKey;
$curl=curl\u init($GoogleRequest);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($curl,CURLOPT_头,false);
//curl_setopt($curl,CURLOPT_HTTPGET,true);
$curl\u response=json\u decode(curl\u exec($curl),true);
echo“
curl\u响应状态:->”$curl\u响应['Status']