src/Panda/Localization/GeoIp.php
public function getCountryCode2ByIP($ipAddress = '')
    {
        // Get remote ip address if empty
        $ipAddress = (empty($ipAddress) ? $this->request->server->get('REMOTE_ADDR') : $ipAddress);

        // Check implementation
        if (!function_exists('geoip_country_code_by_name')) {
            throw new Exception('geoip_country_code_by_name() function is not available.');
        }

        // Return country code
        return geoip_country_code_by_name($ipAddress);
    }
public function getCountryCode2ByIP($ipAddress = '')
    {
        // Get remote ip address if empty
        $ipAddress = (empty($ipAddress) ? $this->request->server->get('REMOTE_ADDR') : $ipAddress);

        // Check implementation
        if (!function_exists('geoip_country_code_by_name')) {
            throw new Exception('geoip_country_code_by_name() function is not available.');
        }

        // Return country code
        return geoip_country_code_by_name($ipAddress);
    }
public function getCountryCode2ByIP ( $ ipAddress = '' ) { // Get remote ip address if empty $ ipAddress = ( empty ( $ ipAddress ) ? $ this -> request -> server -> get ( 'REMOTE_ADDR' ) : $ ipAddress ) ; // Check implementation if ( ! function_exists ( 'geoip_country_code_by_name' ) ) { throw new Exception ( 'geoip_country_code_by_name() function is not available.' ) ; } // Return country code return geoip_country_code_by_name ( $ ipAddress ) ; }
Get the country ISO2A code by ip.

@param string $ipAddress The ip address to get the country code for.

@return string

@throws Exception
Get the country ISO2A code by ip .