php ^ 8.0
phpunit/phpunit": ">=11.1"
Run this composer code
$ composer require sirmerdas/ip-helper
use Sirmerdas\IpHelper\IpTools;
include "vendor/autoload.php";
print_r(IpTools::getClientIpInfo()); // [[address] => ::1,[version] => 6]
echo IpTools::getIpVersion("::1"); // 6
var_dump(IpTools::verifyIpV4("::1")); // false
var_dump(IpTools::verifyIpV6("::1")); // true
echo IpTools::fakeIpV4(); // 127.0.0.1
echo IpTools::fakeIpV6(); // ::1
- This package is This package is created and modified under the MIT License.