mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-11 07:00:57 +00:00
25 lines
389 B
PHP
25 lines
389 B
PHP
<?php
|
|
|
|
namespace App\Components;
|
|
|
|
use ipip\db\City;
|
|
|
|
class IPIP
|
|
{
|
|
/**
|
|
* 查询IP地址的详细信息
|
|
*
|
|
* @param string $ip IPv4
|
|
*
|
|
* @return array|null
|
|
*/
|
|
public static function ip($ip)
|
|
{
|
|
$filePath = public_path('ipip.ipdb');
|
|
|
|
$loc = new City($filePath);
|
|
$result = $loc->findMap($ip, 'CN');
|
|
|
|
return $result;
|
|
}
|
|
} |