Skip to content

Instantly share code, notes, and snippets.

View jharriot's full-sized avatar

Jonathan Harriot jharriot

  • GeekChicInc
  • Huntington Beach, CA
View GitHub Profile
@madeinnordeste
madeinnordeste / PHP-Get-Geocode-from-Address
Last active October 4, 2022 13:30
PHP - Get Geocode (lat, long) from Address
<?php
$address = 'avenida+gustavo+paiva,maceio,alagoas,brasil';
$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;
$long = $output->results[0]->geometry->location->lng;