How to get city from coordinates?
I use google maps api 3 to get city from coordinates. I read the ReverseGeocoding but I did not understand how to have the correct city value from this type of result: http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=false this Funktion returns the Name of a requested City at lat/long. As this Script is from end of 2012. Worked fine for me that time. Returns "unknown" when the API doesn't find any. function get_api ($lat, $long) { $get_API = "http://maps.googleapis.com/maps/api/geocode/json?latlng="; $get_API .= round($lat,2).","; $get_API .= round($long,2);