Skip to content

Instantly share code, notes, and snippets.

@eboominathan
Created April 8, 2017 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eboominathan/bce8be1e211c3db6b4cc1749caa3d6bb to your computer and use it in GitHub Desktop.
Save eboominathan/bce8be1e211c3db6b4cc1749caa3d6bb to your computer and use it in GitHub Desktop.
Get the location details by using latitude and longitude
<?php
$lattitude = 11.016844;
$longitude = 76.955832;
$geocode=file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?latlng='.$lattitude.','.$longitude.'&sensor=false');
$output= json_decode($geocode);
echo $output->results[0]->formatted_address;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment