public function getRequestingIp()
    {
        if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {

            return $_SERVER['HTTP_CF_CONNECTING_IP'];
        }
        elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
        {
            return isset($_SERVER['HTTP_X_FORWARDED_FOR']);
        }
        elseif (isset($_SERVER['HTTP_X_REAL_IP']))
        {
            return isset($_SERVER['HTTP_X_REAL_IP']);
        }
        else
        {
            return $_SERVER['REMOTE_ADDR'];
        }
    }
public function getRequestingIp()
    {
        if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {

            return $_SERVER['HTTP_CF_CONNECTING_IP'];
        }
        elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
        {
            return isset($_SERVER['HTTP_X_FORWARDED_FOR']);
        }
        elseif (isset($_SERVER['HTTP_X_REAL_IP']))
        {
            return isset($_SERVER['HTTP_X_REAL_IP']);
        }
        else
        {
            return $_SERVER['REMOTE_ADDR'];
        }
    }
public function getRequestingIp ( ) { if ( isset ( $ _SERVER [ 'HTTP_CF_CONNECTING_IP' ] ) ) { return $ _SERVER [ 'HTTP_CF_CONNECTING_IP' ] ; } elseif ( isset ( $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] ) ) { return isset ( $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] ) ; } elseif ( isset ( $ _SERVER [ 'HTTP_X_REAL_IP' ] ) ) { return isset ( $ _SERVER [ 'HTTP_X_REAL_IP' ] ) ; } else { return $ _SERVER [ 'REMOTE_ADDR' ] ; } }
Ensures that we get the right IP address even if behind CloudFlare or most proxies

@return string
Ensures that we get the right IP address even if behind CloudFlare or most proxies