src/PHPClientAddr/PHPClientAddr.php
private function getRemodeAddr()
    {
        $ip = NULL;
        if(PHP_SAPI=='cli') {
            $ip = gethostbyname(gethostname());
        } elseif($this->hasServerRemoteAddr()) {
            $ip = $this->server['REMOTE_ADDR'];
        } elseif($this->hasEnvRemoteAddr()) {
            $ip = $this->env['REMOTE_ADDR'];
        }
        return $ip;
    }
private function getRemodeAddr()
    {
        $ip = NULL;
        if(PHP_SAPI=='cli') {
            $ip = gethostbyname(gethostname());
        } elseif($this->hasServerRemoteAddr()) {
            $ip = $this->server['REMOTE_ADDR'];
        } elseif($this->hasEnvRemoteAddr()) {
            $ip = $this->env['REMOTE_ADDR'];
        }
        return $ip;
    }
private function getRemodeAddr ( ) { $ ip = NULL ; if ( PHP_SAPI == 'cli' ) { $ ip = gethostbyname ( gethostname ( ) ) ; } elseif ( $ this -> hasServerRemoteAddr ( ) ) { $ ip = $ this -> server [ 'REMOTE_ADDR' ] ; } elseif ( $ this -> hasEnvRemoteAddr ( ) ) { $ ip = $ this -> env [ 'REMOTE_ADDR' ] ; } return $ ip ; }
Permite obtener la IP real del cliente.
@return string
Permite obtener la IP real del cliente .