| Recommend this page to a friend! |
| Info | Documentation | Reputation | Support forum | Blog | Links |
| Ratings | Unique User Downloads | Download Rankings | ||||
| Not enough user ratings | Total: 154 | All time: 9,043 This week: 524 | ||||
| Version | License | PHP version | Categories | |||
| geohelper-api-client 1.0.0 | BSD License | 5 | PHP 5, Web services, Geography |
PHP-client for Geohelper API.
1) Get composer
2) Run into your project directory:
composer require dmamontov/geohelper-api-client-php ~1.0.0
If you have not used composer before, include autoloader into your project.
require 'path/to/vendor/autoload.php';
$client = new \Geohelper\ApiClient(
'api_key'
);
try {
$response = $client->countriesList();
} catch (\Geohelper\Exception\CurlException $e) {
echo "Connection error: " . $e->getMessage();
}
if ($response->isSuccessful()) {
$countries = isset($response['result']) ? $response['result'] : array();
foreach ($countries as $country) {
echo $country['name'];
}
} else {
echo sprintf(
"Error: [HTTP-code %s] %s",
$response->getStatusCode(),
$response->getErrorMsg()
);
}
| File | Role | Description | ||
|---|---|---|---|---|
| Data | Auxiliary data | |||
| Lic. | License text | |||
| Doc. | Documentation | |||
| / | lib | / | Geohelper |
| File | Role | Description | ||
|---|---|---|---|---|
| |
Class | Class source | ||
| / | lib | / | Geohelper | / | Exception |
| File | Role | Description |
|---|---|---|
| |
Class | Class source |
| |
Class | Class source |
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
| geohelper-api-client-2019-05-02.zip 4KB | |
| geohelper-api-client-2019-05-02.tar.gz 3KB | |
| Install with Composer |
| Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
| 100% |
|
|
| User Comments (1) | |||||
| |||||
| Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.