3.1. Superglobal Arrays

PHP offers several types of superglobal arrays to developers, each with a different useful purpose. A superglobal array (refer back to Chapter 2 for more information on arrays) is a special variable that are always available in scripts, regardless of the current scope of the script (see the Variable Scope section later in this chapter). PHP includes several superglobals:

  • $GLOBALS: Variables available in the global scope

  • $_SERVER: Information about the server

  • $_GET: Data passed using the HTTP GET method

  • $_POST: Data passed using the HTTP POST method

  • $_REQUEST: Data passed via an HTTP request

  • $_FILES: Data passed by an HTML file input

  • $_SESSION: Current session data specific to the user

  • $_COOKIE: Data stored on the user's browser ...

Get PHP for Absolute Beginners 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.