Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
PHP - Get Geocode (lat, long) from Address
$address = 'avenida+gustavo+paiva,maceio,alagoas,brasil';
$geocode = file_get_contents(''.$address.'&sensor=false');
$output= json_decode($geocode);
$lat = $output->results[0]->geometry->location->lat;
$long = $output->results[0]->geometry->location->lng;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.