PHP code example of cimus / geo-bundle

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

    

cimus / geo-bundle example snippets



php app/console cimus:geo:update



$info =  $this->get('cimus.geo')->search('176.121.128.1');

print_r($info);

Array
(
    [country] => RU
    [city] => Чебоксары
    [region] => Республика Чувашия
    [district] => Приволжский федеральный округ
    [latitude] => 56.137451
    [longitude] => 47.244030                                             
    [ip_start] => 176.121.128.0
    [ip_stop] => 176.121.191.255
)



$list = $this->get('cimus.geo')->listCity();

print_r($list);


bash
$ php composer.phar