PHP code example of juju / qqwry

1. Go to this page and download the library: Download juju/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/ */

    

juju / qqwry example snippets


    'providers' => [
        // ...
        juju\QQWry\QQWryServiceProvider::class,
    ]

    'aliases' => [
        // ...
        'QQWry' => juju\QQWry\Facades\QQWry::class,
    ]

	$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(' ') }}