public static function getIPAddress()
    {
        if (isset($_SERVER['HTTP_CLIENT_IP'])) {
            return $_SERVER['HTTP_CLIENT_IP'];
        } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            ///to check ip is pass from proxy
            return $_SERVER['HTTP_X_FORWARDED_FOR'];
        } elseif (isset($_SERVER['REMOTE_ADDR'])) {
            return $_SERVER['REMOTE_ADDR'];
        }

        return null;
    }
public static function getIPAddress()
    {
        if (isset($_SERVER['HTTP_CLIENT_IP'])) {
            return $_SERVER['HTTP_CLIENT_IP'];
        } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            ///to check ip is pass from proxy
            return $_SERVER['HTTP_X_FORWARDED_FOR'];
        } elseif (isset($_SERVER['REMOTE_ADDR'])) {
            return $_SERVER['REMOTE_ADDR'];
        }

        return null;
    }
public static function getIPAddress ( ) { if ( isset ( $ _SERVER [ 'HTTP_CLIENT_IP' ] ) ) { return $ _SERVER [ 'HTTP_CLIENT_IP' ] ; } elseif ( isset ( $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] ) ) { ///to check ip is pass from proxy return $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] ; } elseif ( isset ( $ _SERVER [ 'REMOTE_ADDR' ] ) ) { return $ _SERVER [ 'REMOTE_ADDR' ] ; } return null ; }
Get the ip address of the client
@return string|null Returns fails on failure
Get the ip address of the client