Language Reference
PHP Manual

Predefined variables

PHP provides a large number of predefined variables to any script. The variables represent everything from external variables to built-in environment variables, last error messages to last retrieved headers.

Superglobals

Superglobals are built-in variables that are always available in all scopes. These variables are:

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

Note: Superglobals cannot be used as variable variables inside functions or class methods.

Table of Contents


Language Reference
PHP Manual