PHP code example of latrell / qqwry
1. Go to this page and download the library: Download latrell/qqwry 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/ */
latrell / qqwry example snippets
$ip = mt_rand(); // 取一个随机IP。
$ip = QQWry::ntoa($ip); // 将IP转换成文本型格式。
$record = QQWry::query($ip); // 取出IP对应的地址。
echo "\n", $ip, "\t", $record['country'], "\t", $record['area']; // 输出结果。
@inject('qqwry', 'qqwry')
{{ $qqwry->query('127.0.0.1')->implode(' ') }}