PHP provides a large number of predefined variables to any script which it runs. PHP provides an additional set of predefined arrays containing variables from the web server the environment, and user input. These new arrays are called superglobals −
All the following variables are automatically available in every scope.
PHP Superglobals
| Variable | Description |
|---|---|
| $GLOBALS | Contains a reference to every variable which is currently available within the global scope of the script. The keys of this array are the names of the global variables. |
| $_SERVER | This is an array containing information such as headers, paths, and script locations. The entries in this array are created by the web server. There is no guarantee that every web server will provide any of these. See next section for a complete list of all the SERVER variables. |
| $_GET | An associative array of variables passed to the current script via the HTTP GET method. |
| $_POST | An associative array of variables passed to the current script via the HTTP POST method. |
No comments:
Post a Comment