olakunlevpn/geoiplookup

Geoiplookup.io IP's lookup, Perfect for PHP applications.

1.3 2022-03-05 01:12 UTC

This package is auto-updated.

Last update: 2024-06-05 06:19:14 UTC


README

Geoiplookup.io IP's lookup, Perfect for PHP SDK applications.

Install

Via Composer

$ composer require olakunlevpn/geoiplookup

Usage

require_once "vendor/autoload.php";
use 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();

Pass custom ip address as variable

require_once "vendor/autoload.php";
use Olakunlevpn\Geoiplookup\GeoiplookupClient;

$Geoiplookup = new GeoiplookupClient();

$ipAddress = $_SERVER['REMOTE_ADDR']; 

$data = $Geoiplookup->lookUp($ipAddress);


echo $data->getIp();

Testing

$ phpunit

Credits

License

The MIT License (MIT). Please see License File for more information.