The best way to get details about an IP address, no php ext required. Get ip details from multiple api source.
composer install lefuturiste/iptator
This package use the guzzle http php library to make http request, so curl ext is required.
use Iptator\Scanner;
$scanner = new Scanner();
$ip = $scanner->scan('1.1.1.1');
$ip->isp; // Cloudflare, Inc.
$ip->countryName; // Australia
$ip->city; // South Brisbane
- ipapi.co
- ip-api.com
vendor/bin/phpunit tests