dmamontov/geohelper-api-client-php
最新稳定版本:1.0.0
Composer 安装命令:
composer require dmamontov/geohelper-api-client-php
包简介
PHP client for Geohelper API
关键字:
README 文档
README
PHP-client for Geohelper API.
Requirements
- PHP 5.3 and above
- PHP's cURL support
Install
-
Get composer
-
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() ); }
统计信息
- 总下载量: 3.8k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-10-06