mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-11 23:19:05 +00:00
20 lines
312 B
PHP
20 lines
312 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): ?array {
|
|
$filePath = database_path('ipip.ipdb');
|
|
return (new City($filePath))->findMap($ip, 'CN');
|
|
}
|
|
}
|