The global arrays in php

PHP creates six global arrays that contain the EGPCS(environment, GET, POST, cookies, and server) information

$_COOKIE

Contains any cookie values passed as part of the request, where the keys of the array are the names of the cookies

$_GET

Contains any parameters that are part of a GET request, where the keys of the array are the names of the form parameters

$_POST

Contains any parameters that are part of a POST request, where the keys of the array are the names of the form parameters

$_FILES

Contains information about any uploaded files

$_SERVER

Contains useful information about the web server, as described in the next section

$_ENV

Contains the values of any environment variables, where the keys of the array are the names of the environment variables

These variables are not only global, but are also visible from within function definitions. The $_REQUEST array is also created by PHP automatically. The $_REQUEST array contains the elements of the $_GET, $_POST, and $_COOKIE arrays all in one array variable

Leave a Comment