PHP code example of hulang / think-ip
1. Go to this page and download the library: Download hulang/think-ip 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/ */
hulang / think-ip example snippets
//根据实际情况,基本上用框架(如 thinkphp,Laravel)的话不需要手动引入
//NESCAPED_UNICODE) . PHP_EOL;
//支持自定义文件路径
$qqwry_filepath = '/abspath/qqwry.dat';
$ipv6wry_path = '/abspath/ipv6wry.db';
echo json_encode(IpLocation::getLocation($ip, $qqwry_filepath), JSON_UNESCAPED_UNICODE) . PHP_EOL;