Skip to content

A Simple Address to Lat Lon conversion using Google Geocoder in PHP

Notifications You must be signed in to change notification settings

itsalif/address-geocoder-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A Simple Address to Lat Lon conversion using Google Geocoder in PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages