Reverse GeoCoding-Getting Address from Latitude/Longitude
Google MAP API provides you the way to get Latitude, Longitude, IP Address if you provide the Address. This is called GeoCoding. Are you stuck where you want Address or Region code from Latitude and Longitude? Now, Google MAP API provides reverse way where you have to pass latitude/longitude and Google will give Address containing City, State, Region Code, Country in response. This is called Reverse GeoCoding.
Below is the PHP code for getting Region Code from latitude and longitude.
$url = “http://maps.google.com/maps/geo?q=30.28,-97.73&output=json&key=ABQIAAAAhdDokCu8GspRD8rZaYYaoRR5dndtY5oS-GFuRoRAautbbsCzexTbXFh0ItLJ_JAtzGaD1Nh8I-kRzQ”;
$json_content = file_get_contents($url);
$data = json_decode($json_content);