18/11
2017
Wallogit.com
2017 © Pedro Peláez
Replaced by Google Maps PHP SDK, (*1)
Simple Google Maps Geocoder PHP library. Get Latitude and Longitude of selected address in few steps!, (*2)
You can install the package via composer:, (*3)
composer require biscolab/geocoder:^1.0
$address = 'street <YOUR_STREET>, <YOUR_CITY>, <YOUR_COUNTRY>';
$loc = (new Geocoder($address))->getLocation();
getLocation method returns a GeocoderLocation object. To retrieve latitude (Lat) and longitude (Lng) use the following methods:/** * Return the latitude * * @return float */ $lat = $loc->getLat(); /** * Return the longitude * * @return float */ $lng = $loc->getLng();
That's it!, (*4)