PHP code example of olakunlevpn / geoiplookup
1. Go to this page and download the library: Download olakunlevpn/geoiplookup 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/ */
olakunlevpn / geoiplookup example snippets
php
Olakunlevpn\Geoiplookup\GeoiplookupClient;
$Geoiplookup = new GeoiplookupClient();
$data = $Geoiplookup->lookUp();
echo $data->getIp();
// $data->getIp();
// $data->getIsp();
// $data->getOrganization();
// $data->getHostname();
// $data->getLatitude();
// $data->getLongitude();
// $data->getPostalCode();
// $data->getCity();
// $data->getCountryCode();
// $data->getCountry();
// $data->getContinentCode();
// $data->getContinentName();
// $data->getRegion();
// $data->getDistrict();
// $data->getTimeZone();
// $data->getConnectionType();
// $data->getAsnNumber();
// $data->getAsnOrg();
// $data->getAsn();
// $data->getCurrencyCode();
// $data->GetCurrencyName();
php
Olakunlevpn\Geoiplookup\GeoiplookupClient;
$Geoiplookup = new GeoiplookupClient();
$ipAddress = $_SERVER['REMOTE_ADDR'];
$data = $Geoiplookup->lookUp($ipAddress);
echo $data->getIp();