What are superglobal/global variables ?

Last updated 2 years, 4 months ago | 421 views 75     5

Tags:- PHP

PHP | What are superglobal/global variables?

Superglobal is out of scope limitation. These variables can be accessed from any function, class, or file without doing anything special such as declaring any global variable, etc. These variables store information in an array. Commonly they are used to store and get information from one page to another in an application.

Below is the list of superglobal variables available in PHP:

  • $GLOBALS
  • $_SERVER
  • $_REQUEST
  • $_GET
  • $_POST
  • $_SESSION
  • $_COOKIE
  • $_FILES
  • $_ENV