torben Mon Mar 11 20:54:58 2002 EDT
Modified files:
/phpdoc/en/language variables.xml
Log:
Added an explanation, a bit of expansion, and a pointer to information
regarding the superglobals.
Index: phpdoc/en/language/variables.xml
diff -u phpdoc/en/language/variables.xml:1.36 phpdoc/en/language/variables.xml:1.37
--- phpdoc/en/language/variables.xml:1.36 Mon Mar 11 19:57:46 2002
+++ phpdoc/en/language/variables.xml Mon Mar 11 20:54:58 2002
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.36 $ -->
+<!-- $Revision: 1.37 $ -->
<chapter id="language.variables">
<title>Variables</title>
@@ -116,15 +116,117 @@
which it runs. Many of these variables, however, cannot be fully
documented as they are dependent upon which server is running, the
version and setup of the server, and other factors. Some of these
- variables will not be available when PHP is run on the
- command-line.
+ variables will not be available when PHP is run on the command
+ line. For a listing of these variables, please see the section
+ <link linkend="reserved.variables">Predefined variables</link>.
</simpara>
<simpara>
- A list of many (but not all) of the predefined variables is
- available in the section <link
- linkend="reserved.variables">Predefined variables</link>.
+ From version 4.1.0 onward, PHP provides a set of predefined arrays
+ containing variables from the web server (if applicable), the
+ environment, and user input. These new arrays are rather special
+ in that they are automatically global--i.e., automatically
+ available in every scope. For this reason, they are often known as
+ 'autoglobals' or 'superglobals'. (There is no mechanism in PHP for
+ user-defined superglobals.) The superglobals are listed below;
+ however, for a listing of their contents and further discussion on
+ PHP predefined variables and their natures, please see the section
+ <link linkend="reserved.variables">Predefined variables</link>.
</simpara>
+
+ <variablelist>
+ <title>PHP Superglobals</title>
+ <varlistentry>
+ <term><link linkend="reserved.variables.server">$_SERVER</link></term>
+ <listitem>
+ <simpara>
+ Variables set by the web server or otherwise directly related
+ to the execution environment of the current script. Analogous
+ to the old <varname>$HTTP_SERVER_VARS</varname> array (which is
+ still available, but deprecated).
+ </simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><link linkend="reserved.variables.get">$_GET</link></term>
+ <listitem>
+ <simpara>
+ Variables provided to the script via HTTP GET. Analogous to the
+ old <varname>$HTTP_GET_VARS</varname> array (which is still
+ available, but deprecated).
+ </simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><link linkend="reserved.variables.post">$_POST</link></term>
+ <listitem>
+ <simpara>
+ Variables provided to the script via HTTP POST. Analogous to the
+ old <varname>$HTTP_POST_VARS</varname> array (which is still
+ available, but deprecated).
+ </simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><link linkend="reserved.variables.cookies">$_COOKIES</link></term>
+ <listitem>
+ <simpara>
+ Variables provided to the script via HTTP cookies. Analogous to
+ the old <varname>$HTTP_COOKIE_VARS</varname> array (which is
+ still available, but deprecated).
+ </simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><link linkend="reserved.variables.files">$_FILES</link></term>
+ <listitem>
+ <simpara>
+ Variables provided to the script via HTTP post file
+ uploads. Analogous to the old
+ <varname>$HTTP_POST_FILES</varname> array (which is still
+ available, but deprecated). See <link
+ linkend="features.file-upload.post-method">POST method
+ uploads</link> for more information.
+ </simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><link linkend="reserved.variables.environment">$_ENV</link></term>
+ <listitem>
+ <simpara>
+ Variables provided to the script via the environment. Analogous
+ to the old <varname>$HTTP_ENV_VARS</varname> array (which is
+ still available, but deprecated).
+ </simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><link linkend="reserved.variables.request">$_REQUEST</link></term>
+ <listitem>
+ <simpara>
+ Variables provided to the script via any user input mechanism,
+ and which therefore cannot be trusted. The presence and order
+ of variable inclusion in this array is defined according to the
+ <link linkend="ini.variables-order">variables_order</link>
+ configuration directive. This array has no direct analogue in
+ versions of PHP prior to 4.1.0.
+ </simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><link linkend="reserved.variables.session">$_SESSION</link></term>
+ <listitem>
+ <simpara>
+ Variables which are currently registered to a script's
+ session. Analogous to the old
+ <varname>$HTTP_SESSION_VARS</varname> array (which is still
+ available, but deprecated). See the <link
+ linkend="ref.session">Session handling functions</link> section
+ for more information.
+ </simpara>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</sect1>