-2

I have a lat and long and would like to send these via a http request to something like google maps and retrieve a postcode for the UK.

Is this possible?

Somk
  • 11,869
  • 32
  • 97
  • 143
  • that process is called reverse geocoding... and google maps supports it. https://developers.google.com/maps/documentation/geocoding/ – Orangepill Jul 22 '13 at 18:41
  • You mean like [this](http://www.geocodezip.com/v3_GoogleEx_geocoding-reverse2postcode.html)? – geocodezip Jul 22 '13 at 18:43

1 Answers1

0

$json = file_get_contents("http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=manchester+uk");

$json = json_decode($json);

$json is an array; therefore, you can access any data from http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=manchester+uk

If you need to lookup the lat and lng, you can replace the urls with this: http://maps.googleapis.com/maps/api/geocode/json?latlng=53.39990299999999,-2.30009690&sensor=false