public function get($ip='')
    {
        if (empty($ip))
            $this->getIP();
        else if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
            return false;
        } else {
            $this->ip = $ip;
            $this->ipAsLong = sprintf('%u', ip2long($ip));
        }

        $this->getSypexGeo();
        $data = $this->_sypex->getCityFull($this->ip);
        if (isset($data['city']))
            $this->city = $data['city'];
        if (isset($data['region']))
            $this->region = $data['region'];
        if (isset($data['country']))
            $this->country = $data['country'];
        return empty($data) ? false : $data;
    }
public function get($ip='')
    {
        if (empty($ip))
            $this->getIP();
        else if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
            return false;
        } else {
            $this->ip = $ip;
            $this->ipAsLong = sprintf('%u', ip2long($ip));
        }

        $this->getSypexGeo();
        $data = $this->_sypex->getCityFull($this->ip);
        if (isset($data['city']))
            $this->city = $data['city'];
        if (isset($data['region']))
            $this->region = $data['region'];
        if (isset($data['country']))
            $this->country = $data['country'];
        return empty($data) ? false : $data;
    }
public function get ( $ ip = '' ) { if ( empty ( $ ip ) ) $ this -> getIP ( ) ; else if ( ! filter_var ( $ ip , FILTER_VALIDATE_IP , FILTER_FLAG_IPV4 ) ) { return false ; } else { $ this -> ip = $ ip ; $ this -> ipAsLong = sprintf ( '%u' , ip2long ( $ ip ) ) ; } $ this -> getSypexGeo ( ) ; $ data = $ this -> _sypex -> getCityFull ( $ this -> ip ) ; if ( isset ( $ data [ 'city' ] ) ) $ this -> city = $ data [ 'city' ] ; if ( isset ( $ data [ 'region' ] ) ) $ this -> region = $ data [ 'region' ] ; if ( isset ( $ data [ 'country' ] ) ) $ this -> country = $ data [ 'country' ] ; return empty ( $ data ) ? false : $ data ; }
Get full geo info by remote IP-address
@param string $ip source ip, if empty then determine
@return array geo info|false if error
result array example:
```php
[
'city' => [
'id' => 709717,
'lat' => 48.023000000000003,
'lon' => 37.802239999999998,
'name_ru' => 'Донецк',
'name_en' => 'Donets\'k',
'okato' => '14101',
],
'region' => [
'id' => 709716,
'lat' => 48,
'lon' => 37.5,
'name_ru' => 'Донецкая область',
'name_en' => 'Donets\'ka Oblast\'',
'iso' => 'UA-14',
'timezone' => 'Europe/Zaporozhye',
'okato' => '14',
],
'country' => [
'id' => 222,
'iso' => 'UA',
'continent' => 'EU',
'lat' => 49,
'lon' => 32,
'name_ru' => 'Украина',
'name_en' => 'Ukraine',
'timezone' => 'Europe/Kiev',
],
]
```
Get full geo info by remote IP - address