Details
Geohelper API PHP client
PHP-client for Geohelper API.
Use API documentation
Requirements
- PHP 5.3 and above
- PHP's cURL support
Install
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';
Usage
Get countries
$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()
);
}
|
Name: |
PHP GeoHelper API Client |
Base name: |
geohelper-api-client |
Description: |
Retrieve location lists using the Geohelper API |
Version: |
- |
PHP version: |
5 |
License: |
BSD License |
|
|
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.
|
Files |
|
File |
Role |
Description |
Geohelper (1 file, 3 directories) |
File |
Role |
Description |
Client.php |
Class |
Class source |