1. Go to this page and download the library: Download stilch/sypex-geo 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/ */
stilch / sypex-geo example snippets
$sypexGeoDb = new SypexGeoDb('pathToDbFile');
//Инициализация с кэшированием БД в памяти
$sypexGeoDb = new SypexGeoDb('pathToDbFile', true);
//Создание экземпляра класса для работы с API без ключа
$sypexGeoDb = new SypexGeoNetwork();
//Создание экземпляра класса для работы с API c ключом
$sypexGeoDb = new SypexGeoNetwork('apiKeySypexGeo');
$countryId = $sypexGeo->getCountryId($ip);
$countryIso = $sypexGeo->getCountryIso($ip);
$country = $sypexGeo->getCountry($ip);
$region = $sypexGeo->getRegion($ip);
$city = $sypexGeo->getCity($ip);
$fullInfo = $sypexGeo->getFullInfo($ip);
$fullInfo = $sypexGeo->getCoordinates($ip);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.