---
title: "Discussion on \"Magento 2 - How to Call Global Variable $_SERVER\" | Hashnode"
description: "Discussion on \"Magento 2 - How to Call Global Variable $_SERVER\". Calling $_SERVER directly to that variable is not recommended, so how do we call that variable in Magento 2?\nMagento 2 has class of \\Magento\\Framework\\App\\RequestInterface, and in order to call $_SERVER, we need to use this class. Implementing this c..."
url: "https://hashnode.com/posts/magento-2-how-to-call-global-variable-server/62a4c512a2c282d2d83799ab"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Magento 2 - How to Call Global Variable $\_SERVER](https://fiko.me/magento-2-how-to-call-global-variable-server?utm_source=hashnode&utm_medium=feed)

Calling $\_SERVER directly to that variable is not recommended, so how do we call that variable in Magento 2? Magento 2 has class of \\Magento\\Framework\\App\\RequestInterface, and in order to call $\_SERVER, we need to use this class. Implementing this c...

Jun 11, 2022 · 1 min read · fiko.me  
Updated Sep 27, 2023  
Read the article

-   [#magento](https://hashnode.com/tag/magento)
-   [#magento-2](https://hashnode.com/tag/magento-2)
-   [#php](https://hashnode.com/tag/php)

## Written by

[Fiko Borizqy](https://hashnode.com/@fikoborizqy)

@fikoborizqy · Yogyakarta, Indonesia

  
[View profile](https://hashnode.com/@fikoborizqy)

Magento 2 Developer

I wrote these tutorials for myself in future when I forget for the next steps.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
