Predefined Variables


PHP provides a large number of predefined variables to any script that it runs. These variables are superglobals, which are available anywhere in a script. Here's a list of the primary ones:

  • $_GLOBALS. Contains every variable that is currently available within the global scope of the script. The keys of this array are the names of the global variables.

  • $_SERVER. Variables set by the web server or otherwise directly related to the execution environment of the current script.

  • $_GET. Variables provided to the script via HTTP GET.

  • $_POST. Variables provided to the script via HTTP POST.

  • $_COOKIE. Variables provided to the script via HTTP cookies.

  • $_FILES. Variables provided to the script via HTTP POST file uploads.

  • $_ENV. Variables provided to the script via the environment.

  • $_REQUEST. Variables provided to the script via the GET, POST, and COOKIE input mechanisms.

  • $_SESSION. Variables that are currently registered to a script's session.



    Spring Into PHP 5
    Spring Into PHP 5
    ISBN: 0131498622
    EAN: 2147483647
    Year: 2006
    Pages: 254

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net