Superglobal variable in PHP

PHP Superglobals
  • Superglobals are built-in variables that are always available in all scopes
  • Some predefined variables in PHP are "superglobals", which means they are available in all script.
  • There is no need to do global $variable; to access them within functions.
  • In PHP list of superglobal variables are given below.


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