proipinfo / php-client
PHP模块提供proip.info二进制数据库客户端
1.1.1
2021-09-06 10:06 UTC
Requires (Dev)
- psalm/plugin-symfony: ^2.3
This package is auto-updated.
Last update: 2024-09-24 12:03:44 UTC
README
需求
- PHP 5.6或更高版本
- bcmath扩展
安装
composer require proipinfo/php-client
使用
<?php require dirname(__FILE__) . '/vendor/autoload.php'; $db = new ProIPInfo\DbStream('/path/to/db', true); $client = new ProIPInfo\Client($db); $rec = $client->getRecord('8.8.8.8'); if (empty($rec)) { throw(new \Exception('Not found')); } echo $rec->countryCode; echo $rec->region; echo $rec->city; echo $rec->ISP;
更多信息 ProIP.info文档