PHP code example of businessprocess / geo-service-sdk

1. Go to this page and download the library: Download businessprocess/geo-service-sdk 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/ */

    

businessprocess / geo-service-sdk example snippets




$client = new \GeoService\Service\GeoService();

// set locale if we need
$client->setLocale('en')

$response = $client->countries();

print $response->all(); # '[{"id": ...}'

$response = \GeoService\Facade\Geo::setLocale('ru')->countries();

print $response->all(); # '[{"id": ...}'

$citiesAndTowns = \GeoService\Facade\Geo::getCitiesByCountry('r60199');

//get only cities, default city,town
$cities = \GeoService\Facade\Geo::getCitiesByCountry('r60199', 'city');

bash
# Install Composer
curl -sS https://getcomposer.org/installer | php