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
- At first include the file
include_once 'geocode.php';
- 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'
);
- Now, call the function
$result = getLatLng($opt);
- If it is successful, check 'status' and proceed accordingly
if ($result['status']) {
print_r($result);
}
No copyright. Use & distribute freely :).