“failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found geolocation”. I have got this error while I have tried to got geolocation by latitude and longitude in PHP.
My Code:
<?php
$latitude = “22.2979926”;
$longitude = “87.9121374”;
$geolocation = $latitude.’,’.$longitude;
$request = ‘https://www.googleapis.com/geolocation/v1/geolocate?key=***************************’;
$file_contents = file_get_contents($request);
$json_decode = json_decode($file_contents);
print_r($json_decode);
?>
How can I get the Geolocation by latitude and longitude?
Question and answer is powered by AnsPress.io