public function getClientIP()
    {
        if (isset($this->clientIP)) {
            return $this->clientIP;
        }

        $tmp_ip = '';
        $x_fwd = null;

        //Proxy handling.
        if (array_key_exists('REMOTE_ADDR', $_SERVER)) {
            $tmp_ip = $_SERVER['REMOTE_ADDR'];
        }

        if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
            $x_fwd = $_SERVER["HTTP_X_FORWARDED_FOR"];
        }

        if (self::$x_forwarded_for && ($x_fwd !== null)) {
            $forwarded = explode(",", $x_fwd);
            return trim($forwarded[0]);
        }

        return $tmp_ip;
    }
public function getClientIP()
    {
        if (isset($this->clientIP)) {
            return $this->clientIP;
        }

        $tmp_ip = '';
        $x_fwd = null;

        //Proxy handling.
        if (array_key_exists('REMOTE_ADDR', $_SERVER)) {
            $tmp_ip = $_SERVER['REMOTE_ADDR'];
        }

        if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
            $x_fwd = $_SERVER["HTTP_X_FORWARDED_FOR"];
        }

        if (self::$x_forwarded_for && ($x_fwd !== null)) {
            $forwarded = explode(",", $x_fwd);
            return trim($forwarded[0]);
        }

        return $tmp_ip;
    }
public function getClientIP ( ) { if ( isset ( $ this -> clientIP ) ) { return $ this -> clientIP ; } $ tmp_ip = '' ; $ x_fwd = null ; //Proxy handling. if ( array_key_exists ( 'REMOTE_ADDR' , $ _SERVER ) ) { $ tmp_ip = $ _SERVER [ 'REMOTE_ADDR' ] ; } if ( isset ( $ _SERVER [ "HTTP_X_FORWARDED_FOR" ] ) ) { $ x_fwd = $ _SERVER [ "HTTP_X_FORWARDED_FOR" ] ; } if ( self :: $ x_forwarded_for && ( $ x_fwd !== null ) ) { $ forwarded = explode ( "," , $ x_fwd ) ; return trim ( $ forwarded [ 0 ] ) ; } return $ tmp_ip ; }
Returns the clients IP address.

@return string
Returns the clients IP address .