PHP has a list of built-in variables, which are known as superglobal variables. It provide information about the PHP script’s environment.
The variables are always available in all parts of the script. The following table shows the list of PHP superglobal variables:
Superglobal Variables | Meaning |
---|---|
$GLOBALS | Returns an array that contains global variables. The variable names are used to select which part of the array to access. |
$_SERVER | Returns data about the webserver environment. |
$_GET | Return data from GET requests. |
$_POST | Return data from POST requests. |
$_COOKIE | Return data from HTTP cookies |
$_FILES | Return data from POST file uploads. |
$_ENV | Return information about the script’s environment. |
$_REQUEST | Return data from the HTTP request |
$_SESSION | Return variables registered in a session |
Recent Comments