$url = https://maps.googleapis.com/maps/api/geocode/json?address=111+Park+AveFloor+4New+York%2CNY%2C10022%2CUSA&key=***
让卷曲得到我的lat,lng
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_TIMEOUT_MS, 1000);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
$result = curl_exec($ch);
$info = curl_getinfo($ch);
// dd($info);
curl_close($ch);
$result = json_decode($result, true);
return $result;
看起来我启用的东西比我应该的多,但是当我的卷曲响应一直显示
时array:3 [▼
"error_message" => "This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: Learn more: https://code.google.com/apis/console"
"results" => []
"status" => "REQUEST_DENIED"
]
我忘了/做错了什么?