Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 1.09 KB

README.md

File metadata and controls

43 lines (32 loc) · 1.09 KB

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 :).