PHP Tutorial PHP Advanced PHP References

PHP Superglobals



Several predefined variables in PHP are "superglobals", which they are available in all scopes throughout a script. There is no need to do global $variable; to access them within functions or methods.

These superglobal variables are:

List of Superglobal Variables

VariableDescription
$GLOBALSReferences all variables available in global scope
$_SERVERServer and execution environment information
$_GETHTTP GET variables
$_POSTHTTP POST variables
$_FILESHTTP File Upload variables
$_REQUESTHTTP Request variables
$_SESSIONSession variables
$_ENVEnvironment variables
$_COOKIEHTTP Cookies

❮ PHP - Predefined Variables