8.1. Pregenerated Variables

Before executing a script, PHP creates a set of variables available in a superglobal namespace. They are available inside functions and classes without any extra declaration.

_COOKIE

The _COOKIE variable is an array of cookies sent from the browser to the server. The keys in the array are names of cookies.

_ENV

The _ENV variable is an array of environment variables that existed when the script began. The keys in the array are the names of the environment variables.

_FILES

The _FILES array (Table 8.1) contains information about uploaded files. The keys to the array are the names of the form variables. Each value is an array of information about each file. See Chapter 7 for a discussion of file uploads.

Table 8.1. Elements ...

Get Core PHP Programming, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.