This commit is contained in:
aknife1990 2024-04-29 15:25:46 +08:00
parent 8aa004d3f8
commit 045551c4e2
2 changed files with 8 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class IpInfo {
$location = $reader->get($ip); $location = $reader->get($ip);
$reader->close(); $reader->close();
if( $language && $location['continent'][$language] ){ if( $language && isset($location['continent'][$language]) ){
$location = [ $location = [
'continent' => [ 'continent' => [
'code' => $location['continent']['code'], 'code' => $location['continent']['code'],

6
test.php Normal file
View File

@ -0,0 +1,6 @@
<?php
include "./vendor/autoload.php";
use Aknife\Ip\IpInfo;
print_r(ipInfo::find('159.75.190.197'));
print_r(ipInfo::find('159.75.190.197',"en"));
print_r(IpInfo::find('2402:4e00:1013:e500:0:940e:29d7:3443','full'));