PHP code example of jncinet / qihucms-lbs

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

    

jncinet / qihucms-lbs example snippets


// ip定位
// 路径
route('api.lbs.ip') = 'lbs/ip?ip=IP地址(可选)'

// GPS定位
// 路径
route('api.lbs.gps') = 'lbs/gps?lat=1&lng=2'

// 返回值
"data": [
    'status' => 0,
    'message' => '局域网IP',
        'result' => [
            'ip' => '127.0.0.1',
            'location' => [
                'lng' => 0,
                'lat' => 0
            ],
            'ad_info' => [
                'nation' => '中国',
                'province' => '本地',
                'city' => '局域网',
                'district' => '',
                'adcode' => -1
            ]
        ]
    ]
]