Ratings | | Unique User Downloads | | Download Rankings |
Not enough user ratings | | Total: 153 | | All time: 9,002 This week: 134 |
|
Description | | Author |
This package can retrieve location lists using the Geohelper API.
It can send HTTP requests to the Geohelper API to retrieve several types of lists related with geographic locations like for countries list, country cities list, country regions lists and city streets list.
The class can also retrieve other locale dependent information related with phones, service locality and post codes. Innovation Award
 May 2019
Number 9 |
Knowing details about the location in the world where each user is, it is a very important for many types of applications.
This package not only is able to determine the location of a user based on the IP address of his computer, but also other details like countries lists, country city lists and region lists where the users may be located.
Manuel Lemos |
| |
 |
|
Innovation award
 Nominee: 6x |
|
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()
);
}
|
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.