I try to retrieve the latitude and longitude data by postalcode/zipcode.
This is the URL that I'm using:
http://maps.google.com/maps/api/geocode/json?address=9462AA
The url returns JSON data (including latitude/longitude values) once I open it via the browser.
But when I call the exact same URL via the PHP file_get_contents
method, it returns 'ZERO_RESULTS'.
$url = 'http://maps.google.com/maps/api/geocode/json?address=9462AA';
$geocode = file_get_contents($url);
echo $url;
echo $geocode;
This prints the following result:
URL: http://maps.google.com/maps/api/geocode/json?address=9462AA
Geocode:
{
"results" : [],
"status" : "ZERO_RESULTS"
}
What am I doing wrong?
Thank you!