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
Variable | Description |
---|---|
$GLOBALS | References all variables available in global scope |
$_SERVER | Server and execution environment information |
$_GET | HTTP GET variables |
$_POST | HTTP POST variables |
$_FILES | HTTP File Upload variables |
$_REQUEST | HTTP Request variables |
$_SESSION | Session variables |
$_ENV | Environment variables |
$_COOKIE | HTTP Cookies |
❮ PHP - Predefined Variables