A Simple Address to Lat Lon conversion using Google Geocoder in PHP
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitattributes
.gitignore
README.md
example.php
geocode.php

README.md

Address to Lat & Lon conversion script in PHP using Google Geocoder

Address to Lat & Lon conversion script in PHP using Google Geocoder. It does not require any Google Maps API Key. Please also check Google Maps Terms & FAQ.

Read more here: http://www.itsalif.info/content/address-lat-lon-without-api-google-maps-geocoder-php

How to Use

  1. At first include the file
include_once 'geocode.php';
  1. Define the options to be passed on to the function/method
// define the address and set sensor to false
$opt = array (
	'address' => urlencode('Yonge and Bloor, Toronto, Canada'),
	'sensor'  => 'false'
);
  1. Now, call the function
$result = getLatLng($opt);
  1. If it is successful, check 'status' and proceed accordingly
if ($result['status']) {
    print_r($result);
}

Credits & License

No copyright. Use & distribute freely :).