PHP code example of nem-c / ip2loc-lite

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

    

nem-c / ip2loc-lite example snippets


'providers' => array(
    // ...

    'NemC\IP2LocLite\Providers\IP2LocLiteServiceProvider',
)

// ...
$geoForIp = IP2LocLite::get('2.16.0.234');
// ...

/**
 * object(stdClass)[521]
 *   public 'long_from' => int 34603008
 *   public 'long_to' => int 34603263
 *   public 'country_iso2' => string 'US' (length=2)
 *   public 'country_name' => string 'United States' (length=13)
 *   public 'region_name' => string 'California' (length=10)
 *   public 'city_name' => string 'Los Angeles' (length=11)
 */



return [
    'username' => '', //your IP2Location account username
    'password' => '', //your IP2Location account password
    'rememberMe' => 'on',
    'database' => 'DB3LITE',
];
bash
$ php artisan ip2loclite:download-csv
bash
$ php artisan ip2loclite:download-csv && php ip2loclite:import-csv