PHP code example of qqzeng / qzdb
1. Go to this page and download the library: Download qqzeng/qzdb library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
qqzeng / qzdb example snippets
qzeng\Ip\QzdbBuilder;
$reader = QzdbBuilder::path('demo/qqzeng-ip-ult.qzdb')->build();
$loc = $reader->find('118.115.99.0');
if ($loc !== null) {
echo $loc->get('country') . ' ' . $loc->get('city') . ' ' . $loc->get('isp') . PHP_EOL;
// 输出: 中国 成都 中国电信
}
$reader->close();