marcoboom / google-maps-geocode-api
Simple PHP wrapper for the Google Maps Geocode API
Installs: 10 143
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.5.0
This package is not auto-updated.
Last update: 2024-11-23 18:01:09 UTC
README
Simple PHP wrapper for the Google Maps Geocode API
Installation and Requirements
First, you'll need to require the package with Composer:
$ composer require marcoboom/google-maps-geocode-api
This package requires PHP 5.4 and Guzzle
Usage
$geo = new GoogleMapsGeocodeApi\Geocode("Kalverstraat 100 Amsterdam"); echo "Street: ".$geo->street().PHP_EOL; echo "Housenumber: ".$geo->housenumber().PHP_EOL; echo "Postcode: ".$geo->postcode().PHP_EOL; echo "City: ".$geo->city().PHP_EOL; echo "Town: ".$geo->town().PHP_EOL; echo "Province: ".$geo->state().PHP_EOL; echo "Country: ".$geo->country().PHP_EOL; echo "Country code: ".$geo->country_code().PHP_EOL; echo "Latitude: ".$geo->lat().PHP_EOL; echo "Longitude: ".$geo->lon().PHP_EOL; echo "Formatted address: ".$geo->formatted().PHP_EOL;