PHP code example of superdry / geolocation

1. Go to this page and download the library: Download superdry/geolocation library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

superdry / geolocation example snippets

sh
$ php -r "readfile('https://getcomposer.org/installer');" | php && php composer.phar install
 php
$street = 'Koningin Maria Hendrikaplein';
$streetNumber = '1';
$city = 'Gent';
$zip = '1';
$country = 'belgium';
$geolocation = new GeolocationService();
$result = $geolocation->getCoordinates(
    $street,
    $streetNumber,
    $city,
    $zip,
    $country
);
 php
$latitude = 51.0363935;
$longitude = 3.7121008;
$geolocation = new GeolocationService();
$result = $geolocation->getAddress(
    $latitude,
    $longitude
);