Skip to content

Instantly share code, notes, and snippets.

@bondarewicz
Last active April 13, 2018 17:01
Show Gist options
  • Save bondarewicz/7101128 to your computer and use it in GitHub Desktop.
Save bondarewicz/7101128 to your computer and use it in GitHub Desktop.
PHP: Google GeoCoding Example
<?php
$input = "1600 Amphitheatre Parkway, Mountain View, CA";
$request = array();
$request['url'] = "http://maps.googleapis.com/maps/api/geocode/json?address=";
$request['address'] = urlencode($input);
$request['sensor'] = "&sensor=true";
print "<pre>"; print @file_get_contents(join('',$request));
?>
@RJTMediaGroup
Copy link

Short and Sweet, works beautifully. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment