PHP code example of conquer / geoip

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

    

conquer / geoip example snippets


 'components' => [
        'geoip' => [
            'class' => 'conquer\geoip\Geoip',
            'cityTable' => 'geoip.city',
            'districtTable' => 'geoip.district',
            'rangeTable' => 'geoip.range',
            'regionTable' => 'geoip.region',
        ],
    ],

'bootstrap' => ['log', 'geoip'],

$range = Range::findByIp(\Yii::$app->request->userIP);

echo $range->city->city_name;


$ php composer.phar