The following code shows how to geocode an address to obtain google maps latitude and longitude values:
1 2 3 4 5 6 7 |
$address = "your address here"; $geocode=file_get_contents("http://maps.google.com/maps/api/geocode/json?address=".$address."&sensor=false"); $output= json_decode($geocode); $lat = $output->results[0]->geometry->location->lat; $lng = $output->results[0]->geometry->location->lng; |
et voilà!