cvs: phpdoc /he/language variables.xml
| From: | shlomi loubaton | Date: | Thu, 07 Feb 2002 14:01:57 +0000 |
| Subject: | cvs: phpdoc /he/language variables.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969342034@lists.php.net to get a copy of this message | ||
shlomi Thu Feb 7 09:01:57 2002 EDT
Modified files:
/phpdoc/he/language variables.xml
Log:
fully translated
Index: phpdoc/he/language/variables.xml diff -u phpdoc/he/language/variables.xml:1.1 phpdoc/he/language/variables.xml:1.2 --- phpdoc/he/language/variables.xml:1.1 Tue Feb 5 21:46:20 2002 +++ phpdoc/he/language/variables.xml Thu Feb 7 09:01:56 2002 @@ -2,10 +2,10 @@ <!-- EN-Revision: 1.33 Maintainer: shlomi Status: working --> <chapter id="language.variables"> - <title>Variables</title> + <title>îùúðéí</title> <sect1 id="language.variables.basics"> - <title>Basics</title> + <title>äñáø áñéñé</title> <simpara> îùúðéí á-PHP îéåöâéí òì-éãé ùí òí ñéîï äãåìø áúçéìúå. @@ -366,8 +366,8 @@ <term>$SERVER_SIGNATURE</term> <listitem> <simpara> - String containing the server version and virtual host name - which are added to server-generated pages, if enabled. + îçøåæú äîëéìä àú âøñú äùøú åùí ä-host äåéøèåàìé. äîçøåæú úöåøó + ìãôéí äðåöøéí òì-éãé äùøú àí àåôöéä æå îàåôùøú. </simpara> </listitem> </varlistentry> @@ -410,65 +410,62 @@ <title>îùúðé ñáéáä</title> <simpara> - These variables are imported into PHP's global namespace from the - environment under which the PHP parser is running. Many are - provided by the shell under which PHP is running and different - systems are likely running different kinds of shells, a - definitive list is impossible. Please see your shell's - documentation for a list of defined environment variables. + îùúðéí àìå îéåáàéí îäñáéáä ùúçúéä øõ îôøù ä-PHP + ìúåê îùúðéí âìåáìéí áñ÷øéôè. øáéí îäí îéåáàéí îúåëðéåú + äîòèôú (shell) ùúçúéä øöä PHP åëàùø îùúîùéí á-PHP áîòøëåú + ùåðåú åáúåëðéåú îòèôú ùåðåú, ìà ðéúï ìúòã øùéîä àçéãä ùì + îùúðéí àìå. éù ìòééï áúéòåã úåëðú äîòèôú ì÷áìú øùéîä ùì îùúðé äñáéáä. </simpara> <simpara> - Other environment variables include the CGI variables, placed - there regardless of whether PHP is running as a server module or - CGI processor. + îùúðé ñáéáä àçãéí éëììå àú îùúðé ä-CGI äîîå÷îéí ùí ëàùø PHP øöä + ëîåãåì ùøú åâí ëàùø PHP øöä ëîòáã CGI. </simpara> </sect2> <sect2 id="language.variables.predefined.php"> - <title>PHP variables</title> + <title>îùúðé-PHP</title> <simpara> - These variables are created by PHP itself. The - <varname>$HTTP_*_VARS</varname> variables are available only if - the <link linkend="ini.track-vars">track_vars</link> - configuration is turned on. When enabled, the variables are - always set, even if they are empty arrays. This prevents - a malicious user from spoofing these variables. + îùúðéí àìå ðåöøéí òì-éãé PHP. ëì äîùúðéí áöåøú + <varname>$HTTP_*_VARS</varname> éäéå æîéðéí ø÷ àí äàåôöéä + <link linkend="ini.track-vars">track_vars</link> îàåôùøú. + ëàùø àåôöéä æå îàåôùøú, îùúðéí àìå úîéãéåâãøå, àôéìå + àí éåâãøå ëîòøëéí øé÷éí ëãé ìîðåò îîùúîù áòì ëååðú æãåï + ìùðåú àú òøëí. </simpara> <note> <para> - As of PHP 4.0.3, <link - linkend="ini.track-vars">track_vars</link> is always turned on, - regardless of the configuration file setting. + äçì îâøñä 4.0.3 ùì PHP äàåôöéä <link + linkend="ini.track-vars">track_vars</link> úîéã ôòéìä + ììà äúçùáåú áäâãøúä á÷åáõ ääâãøåú ùì PHP. </para> </note> <note> <para> - The new "Superglobals" were added in PHP version 4.1.0. See the - <ulink url="&url.php.release4.1.0;">4.1.0 Release - Announcement</ulink> for more details. These are the + ðåñôå îùúðéí "ñåôø-âìåáìéí" çãùéí îâøñä 4.1.0 . éù ìòééï + á<ulink url="&url.php.release4.1.0;">äëøæä ùì PHP 4.1.0 </ulink> + ìîéãò ðåñó. äîùúðéí äçãùéí <varname>$_GET</varname>, <varname>$_POST</varname>, <varname>$_ENV</varname>, <varname>$_SERVER</varname>, <varname>$_COOKIE</varname>, <varname>$_REQUEST</varname> <varname>$_FILES</varname>, and <varname>$_SESSION</varname> - arrays, and they are informally known as - <emphasis>Superglobals</emphasis> since they are always - available without regard to scope. These deprecate the older - respective <varname>$HTTP_*_VARS</varname> arrays. + äí îòøëéí ùîåâãøéí ë"ñåôø-âìåáìéí" îàçø ùäí æîéðéí úîéã ììà úìåú + áèååç äâãøú äðúåðéí (scope). + îùúðéí àìå îçìéôéí àú îòøëé ä-<varname>$HTTP_*_VARS</varname> + ùäéå áòáø áùéîåù. </para> </note> <para> - If the <link - linkend="ini.register-globals">register_globals</link> directive - is set, then these variables will also be made available in the - global scope of the script; i.e., separate from the - <varname>$HTTP_*_VARS</varname> and <varname>$_*</varname> - arrays. For related information, see the security chapter titled - <link linkend="security.registerglobals">Using Register Globals</link>. + àí àåôöééú <link + linkend="ini.register-globals">register_globals</link> îàåôùøú, + éäéå îùúðéí àìå æîéðéí âí ëï áèååç äîùúðéí äâìåáìéí áðôøã îîòøëé + ä-<varname>$HTTP_*_VARS</varname> äå-<varname>$_*</varname>. + ìîéãò ðåñó, éù ìòééï áôø÷ àáèçú äîéãò ùëåúøúå <link + linkend="security.registerglobals">àåôï äùéîåù áøéùåí âìåáìéí</link>. </para> <para> @@ -477,10 +474,10 @@ <term>$argv</term> <listitem> <simpara> - Array of arguments passed to the script. When the script is - run on the command line, this gives C-style access to the - command line parameters. When called via the GET method, this - will contain the query string. + îòøê äîëéì àú øùéîú äàøâåîðèéí äîåòáøéí ìñ÷øéôè. áòú äøöú + ñ÷øéôè îùåøú äô÷åãä, îòøê æä îàôùø âéùä áñâðåï ùôú C ìôøîèøéí + îùåøú äô÷åãä. ëàùø òîåã î÷áì ôðééä áùéèú GET , îùúðä æä éëéì + àú ä-query string. </simpara> </listitem> </varlistentry> @@ -489,8 +486,8 @@ <term>$argc</term> <listitem> <simpara> - Contains the number of command line parameters passed to the - script (if run on the command line). + îëéì àú îñôø äôøîèøéí äîåòáøéí áàîöòåú ùåøú äô÷åãä ìñ÷øéôè + (àí äñ÷øéôè îåøõ îùåøú äô÷åãä). </simpara> </listitem> </varlistentry> @@ -499,9 +496,8 @@ <term>$PHP_SELF</term> <listitem> <simpara> - The filename of the currently executing script, relative to - the document root. If PHP is running as a command-line - processor, this variable is not available. + ùí ä÷åáõ ùì äñ÷øéôè äðåëçé, éçñéú ìñôøééä äøàùéú ùì äòîåã. + àí PHP îåøöú áùåøú äô÷åãä, îùúðä æä àéðå æîéï. </simpara> </listitem> </varlistentry> @@ -510,8 +506,8 @@ <term>$HTTP_COOKIE_VARS</term> <listitem> <simpara> - An associative array of variables passed to the current - script via HTTP cookies. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + ãøê òåâéåú HTTP. </simpara> </listitem> </varlistentry> @@ -520,9 +516,10 @@ <term>$_COOKIE</term> <listitem> <simpara> - An associative array of variables passed to the current - script via HTTP cookies. Automatically global in any - scope. Introduced in PHP 4.1.0. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + ãøê òåâéåú HTTP. + îùúðä æä îåâãø áëì èååç îùúðéí ëìùäå. + ðåñó ì-PHP äçì îâøñä 4.1.0 . </simpara> </listitem> </varlistentry> @@ -531,8 +528,8 @@ <term>$HTTP_GET_VARS</term> <listitem> <simpara> - An associative array of variables passed to the current - script via the HTTP GET method. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + ãøê ùéèú HTTP GET. </simpara> </listitem> </varlistentry> @@ -541,9 +538,10 @@ <term>$_GET</term> <listitem> <simpara> - An associative array of variables passed to the current - script via the HTTP GET method. Automatically global in - any scope. Introduced in PHP 4.1.0. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + ãøê ùéèú HTTP GET. + îùúðä æä îåâãø áëì èååç îùúðéí ëìùäå. + ðåñó ì-PHP äçì îâøñä 4.1.0 . </simpara> </listitem> </varlistentry> @@ -552,8 +550,8 @@ <term>$HTTP_POST_VARS</term> <listitem> <simpara> - An associative array of variables passed to the current - script via the HTTP POST method. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + ãøê ùéèú HTTP POST. </simpara> </listitem> </varlistentry> @@ -562,9 +560,10 @@ <term>$_POST</term> <listitem> <simpara> - An associative array of variables passed to the current - script via the HTTP POST method. Automatically global in - any scope. Introduced in PHP 4.1.0. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + ãøê ùéèú HTTP POST. + îùúðä æä îåâãø áëì èååç îùúðéí ëìùäå. + ðåñó ì-PHP äçì îâøñä 4.1.0 . </simpara> </listitem> </varlistentry> @@ -573,11 +572,11 @@ <term>$HTTP_POST_FILES</term> <listitem> <simpara> - An associative array of variables containing information - about files uploaded via the HTTP POST method. See <link - linkend="features.file-upload.post-method">POST method - uploads</link> for information on the contents of - <varname>$HTTP_POST_FILES</varname>. Introduced in 4.0.0. + îòøê àñåöéàèéáé ùì îùúðéí äîëéìéí îéãò òì ÷áöéí ùäåòìå ìùøú + áùéèú HTTP POST. éù ìòééï á<link + linkend="features.file-upload.post-method">äòìàú ÷áöéí + áùéèú POST</link> ìîéãò òì úëåìúå ùì <varname>$HTTP_POST_FILES</varname>. + ðåñó ì-PHP äçì îâøñä 4.0.0. </simpara> </listitem> </varlistentry> @@ -586,12 +585,12 @@ <term>$_FILES</term> <listitem> <simpara> - An associative array of variables containing information - about files uploaded via the HTTP POST method. See <link - linkend="features.file-upload.post-method">POST method - uploads</link> for information on the contents of - <varname>$_FILES</varname>. Automatically global in any scope. - Introduced in PHP 4.1.0. + îòøê àñåöéàèéáé ùì îùúðéí äîëéìéí îéãò òì ÷áöéí ùäåòìå ìùøú + áùéèú HTTP POST. éù ìòééï á<link + linkend="features.file-upload.post-method">äòìàú ÷áöéí + áùéèú POST</link> ìîéãò òì úëåìúå ùì <varname>$_FILES</varname>. + îùúðä æä îåâãø áëì èååç îùúðéí ëìùäå. + ðåñó ì-PHP äçì îâøñä 4.1.0 . </simpara> </listitem> </varlistentry> @@ -600,8 +599,8 @@ <term>$HTTP_ENV_VARS</term> <listitem> <simpara> - An associative array of variables passed to the current - script via the parent environment. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + îñáéáú äàá. </simpara> </listitem> </varlistentry> @@ -610,9 +609,10 @@ <term>$_ENV</term> <listitem> <simpara> - An associative array of variables passed to the current - script via the parent environment. Automagically global - in any scope. Introduced in PHP 4.1.0. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + îñáéáú äàá. + îùúðä æä îåâãø áëì èååç îùúðéí ëìùäå. + ðåñó ì-PHP äçì îâøñä 4.1.0 . </simpara> </listitem> </varlistentry> @@ -621,9 +621,8 @@ <term>$HTTP_SERVER_VARS</term> <listitem> <simpara> - An associative array of variables passed to the current - script from the HTTP server. These variables are analogous to - the Apache variables described above. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + îäùøú. òøëéí àìå î÷áéìéí ìîùúðé ùøú Apache äîúåàøéí ìîòìä. </simpara> </listitem> </varlistentry> @@ -632,10 +631,10 @@ <term>$_SERVER</term> <listitem> <simpara> - An associative array of variables passed to the current - script from the HTTP server. These variables are analogous to - the Apache variables described above. Automatically global - in any scope. Introduced in PHP 4.1.0. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + îäùøú. òøëéí àìå î÷áéìéí ìîùúðé ùøú Apache äîúåàøéí ìîòìä. + îùúðä æä îåâãø áëì èååç îùúðéí ëìùäå. + ðåñó ì-PHP äçì îâøñä 4.1.0 . </simpara> </listitem> </varlistentry> @@ -644,8 +643,7 @@ <term>$HTTP_SESSION_VARS</term> <listitem> <simpara> - An associative array of session variables passed to the current - script. + îòøê àñåöéàèéáé äîëéì àú îùúðé ä-session äîåòáøéí ìñ÷øéôè äðåëçé. </simpara> </listitem> </varlistentry> @@ -654,11 +652,12 @@ <term>$_SESSION</term> <listitem> <simpara> - An associative array of session variables passed to the - current script. Automatically global in any scope. Creating - new entries in the $_SESSION array will automatically - register them as session variables, as if you called - <function>session_register</function>. Introduced in PHP 4.1.0. + îòøê àñåöéàèéáé äîëéì àú îùúðé ä-session äîåòáøéí ìñ÷øéôè äðåëçé. + îùúðä æä îåâãø áëì èååç îùúðéí ëìùäå. + éöéøú úàéí çãùéí áîòøê æä úâøåí ìøéùåí àåèåîèé ùì ðúåðéí àìå + ëîùúðé session áãåîä ìôòåìä äîúáöòú áòú ÷øéàä ìôåð÷öéä + <function>session_register</function>. + ðåñó ì-PHP äçì îâøñä 4.1.0 . </simpara> </listitem> </varlistentry> @@ -667,10 +666,10 @@ <term>$_REQUEST</term> <listitem> <simpara> - An associative array merged from the GET, POST, and Cookie variables. - In other words - all the information that is coming from the user, - and that from a security point of view, cannot be trusted. - Automatically global in any scope. Introduced in PHP 4.1.0. + îòøê àñåöéàèéáé äîîæâ àú ëì äîéãò îîùúðé GET, POST å-Cookie . + áîéìéí àçøåú, äåà îëéì àú ëì äîéãò äîâéò îäîùúîù åîáçéðú àáèçú îéãò + àéðå îåîìõ ìùéîåù ëé ìà ðéúï ìáèåç áîéãò æä. + ðåñó ì-PHP äçì îâøñä 4.1.0 . </simpara> </listitem> </varlistentry> @@ -684,13 +683,12 @@ <sect1 id="language.variables.scope"> - <title>Variable scope</title> + <title>èååç ääâãøä ùì îùúðéí</title> <simpara> - The scope of a variable is the context within which it is defined. - For the most part all PHP variables only have a single scope. - This single scope spans included and required files as well. For - example: + èååç ääâãøä ùì îùúðä äåà ä÷åðè÷ñè ùáå äîùúðä îåâãø. + ìëì îùúðé PHP éù èååç äâãøä àçã áìáã. + èååç æä ëåìì âí ÷áöéí îñåôçéí.ìãåâîä: </simpara> <informalexample> <programlisting role="php"> @@ -701,11 +699,10 @@ </programlisting> </informalexample> <simpara> - Here the <varname>$a</varname> variable will be available within - the included <filename>b.inc</filename> script. However, within - user-defined functions a local function scope is introduced. Any - variable used inside a function is by default limited to the local - function scope. For example: + äîùúðä <varname>$a</varname> éäéä îåâãø âí á÷åáõ äîñåôç-<filename>b.inc</filename>. + ìòåîú æàú, áôåð÷öéä ùäåâãøä òì-éãé äîùúîù ÷ééí èååç äâãøä ìå÷àìé. + ëì îùúðä áúåê äôåð÷öéä îåâãø áèååç äôåð÷öéä áìáã ëáøéøú îçãì. + ìãåâîä: </simpara> <informalexample> @@ -724,16 +721,13 @@ </informalexample> <simpara> - This script will not produce any output because the echo statement - refers to a local version of the <varname>$a</varname> variable, - and it has not been assigned a value within this scope. You may - notice that this is a little bit different from the C language in - that global variables in C are automatically available to - functions unless specifically overridden by a local definition. - This can cause some problems in that people may inadvertently - change a global variable. In PHP global variables must be - declared global inside a function if they are going to be used in - that function. An example: + ñ÷øéôè æä ìà éãôéñ ÷ìè ëé ô÷åãú ä-echo îúééçñú ìâøñä äìå÷àìéú ùì + äîùúðä <varname>$a</varname>, åîùúðä æä ìà ÷éáì äöáä áèååç äâãøúå. + ðéúï ìøàåú ùäúðäâåú æå ùåðä áî÷öú îäúðäâåú ùôú C áëê ùîùúðéí âìåáìéí + áùôú C æîéðéí àåèåîèéú âí áôåð÷öéåú àìà àí ðãøñå òì-éãé äâãøä ìå÷àìéú. + úúëï áòéä ëàùø úëðú éðñä ììà äöìçä éúøä ìùðåú àú òøëå ùì îùúðä âìåáìé + îúåê ôåð÷öéä. îùúðä âìåáìé á-PHP çééá ìäéåú îåöäø ëîùúðä âìåáìé àí + ÷ééîú ëååðä ìäùúîù áîùúðä æä îúåê äôåð÷öéä. ãåâîä: </simpara> <informalexample> @@ -756,17 +750,16 @@ </informalexample> <simpara> - The above script will output "3". By declaring - <varname>$a</varname> and <varname>$b</varname> global within the - function, all references to either variable will refer to the - global version. There is no limit to the number of global - variables that can be manipulated by a function. + äñ÷øéôè éãôéñ "3". ëàùø äîùúðéí <varname>$a</varname> å- <varname>$b</varname> + îåâãøéí ëâìåáìéí áôåð÷öéä, ëì äúééçñåú àìéäí úúéçñ ìâøñä äâìåáìéú + ùìäí. àéï äâáìä ìîñôø äîùúðéí äâìåáìéí ùôåð÷öéä + éëåìä ìùðåú. </simpara> <simpara> - A second way to access variables from the global scope is to use - the special PHP-defined <varname>$GLOBALS</varname> array. The - previous example can be rewritten as: + + ãøê ðåñôú ìâùú èååç äîùúðéí äâìåáìéí äéà áòæøú äîòøê äîåâãø îøàù- + <varname>$GLOBALS</varname>. àôùø ìëúåá àú äãåâîä ä÷åãîú âí áöåøä äæå: </simpara> <informalexample> @@ -787,17 +780,15 @@ </informalexample> <simpara> - The <varname>$GLOBALS</varname> array is an associative array with - the name of the global variable being the key and the contents of - that variable being the value of the array element. + äîòøê <varname>$GLOBALS</varname> äåà îòøê àñåöéàèéáé áàåôï + ùùí äîùúðä äâìåáìé äåà äîôúç ìòøê åòøê äîùúðä äâìåáìé äåà + äòøê ùì úà æä áîòøê. </simpara> <simpara> - Another important feature of variable scoping is the - <emphasis>static</emphasis> variable. A static variable exists - only in a local function scope, but it does not lose its value - when program execution leaves this scope. Consider the following - example: + úëåðä ðåñôú ùéù ìöééï àú çùéáåúä äéà äîùúðä ä<emphasis>ñèàèé</emphasis>. + îùúðä ñèàèé ÷ééí ø÷ áèååç ìå÷àìé ùì ôåð÷öéä àê àéðå îàáã + àú òøëå ìàçø ñéåí äøöú äôåð÷öéä. ìãåâîä: </simpara> <informalexample> @@ -814,13 +805,12 @@ </informalexample> <simpara> - This function is quite useless since every time it is called it - sets <varname>$a</varname> to <literal>0</literal> and prints - "0". The <varname>$a</varname>++ which increments the - variable serves no purpose since as soon as the function exits the - <varname>$a</varname> variable disappears. To make a useful - counting function which will not lose track of the current count, - the <varname>$a</varname> variable is declared static: + ôåð÷öéä æå äéà çñøú úåòìú ìçìåèéï ëé áëì ÷øéàä ìôåð÷öéä, îúàôñ + òøëå ùì äîùúðä <varname>$a</varname> åäôåð÷öéä úãôéñ "0". + ôòåìú ä- <varname>$a++</varname> ìà îùøúú ùåí îèøä ëé ìàçø äéöéàä îäôåð÷öéä, + äîùúðä <varname>$a</varname> ðòìí. ëãé ìééöø ôåð÷öéú ñôéøä + ùéîåùéú àñåø ìðå ìàáã àú äòøê äðåëçé ùì <varname>$a</varname> åìëï + îùúðä æä îåâãø ëîùúðä ñèàèé: </simpara> <informalexample> @@ -837,18 +827,16 @@ </informalexample> <simpara> - Now, every time the Test() function is called it will print the - value of <varname>$a</varname> and increment it. + òëùéå, áëì ÷øéàä ìôåð÷öéä Test, éåãôñ òøëå ùì äîùúðä <varname>$a</varname> + åàçø-ëê éåâãì òøëå. </simpara> <simpara> - Static variables also provide one way to deal with recursive - functions. A recursive function is one which calls itself. Care - must be taken when writing a recursive function because it is - possible to make it recurse indefinitely. You must make sure you - have an adequate way of terminating the recursion. The following - simple function recursively counts to 10, using the static - variable <varname>$count</varname> to know when to stop: + àôùø ìäùúîù áîùúðä ñèàèé âí ìöåøê èéôåì áôåð÷öéåú ø÷åøñéáéåú. + ôåð÷öéä ø÷åøñéáéú äéà ôåð÷öéä ù÷åøàú ìòöîä. áëúéáú ôåð÷öéåú ø÷åøñéáéåú éù ìùéí ìá + áëúéáú úðàé äôñ÷ä îúàéí àçøú éååöø îöá ùäôåð÷öéä úøåõ áàåôï àéðñåôé. + äôåð÷öéä äø÷åøñéáéú äáàä ôùåè ñåôøú òã 10 úåê ùéîåù áîùúðä ñèàèé- + <varname>$count</varname> ëãé ìãòú îúé ìòöåø: </simpara> <informalexample> @@ -872,12 +860,12 @@ </sect1> <sect1 id="language.variables.variable"> - <title>Variable variables</title> + <title>ùîåú îùúðéí ùîùúðéí</title> <simpara> - Sometimes it is convenient to be able to have variable variable - names. That is, a variable name which can be set and used - dynamically. A normal variable is set with a statement such as: + ìòéúéí æä ðåç ìäùúîù áùîåú îùúðéí - îùúðéí. ëìåîø, ùí îùúðä + éëåì ìä÷áò òì-éãé äúåëðéú áöåøä ãéðàîéú. îùúðä øâéì î÷áì äöáä + áàîöòåú ô÷åãä ëâåï: </simpara> <informalexample> @@ -889,10 +877,9 @@ </informalexample> <simpara> - A variable variable takes the value of a variable and treats that - as the name of a variable. In the above example, - <emphasis>hello</emphasis>, can be used as the name of a variable - by using two dollar signs. i.e. + îùúðä ùùîå îùúðä ìå÷ç àú äòøê ùì äîùúðä åîúééçñ àìéå ëàì ùí îùúðä. + áãåâîä ä÷åãîú, äîçøåæú <emphasis>hello</emphasis> éëåìä ìùîù âí ëùí + îùúðä òì-éãé ùéîåù áùðé ñéîðé ãåìø: </simpara> <informalexample> @@ -904,10 +891,9 @@ </informalexample> <simpara> - At this point two variables have been defined and stored in the - PHP symbol tree: <varname>$a</varname> with contents "hello" and - <varname>$hello</varname> with contents "world". Therefore, this - statement: + áð÷åãä æå îåâãøéí ùðé îùúðéí áèáìú äñîìéí ùì PHP. äîùúðä <varname>$a</varname> + ùòøëå "hello" åäîùúðä <varname>$hello</varname> ùòøëå "world". + ëôåòì éåöà, äô÷åãä: </simpara> <informalexample> @@ -919,7 +905,7 @@ </informalexample> <simpara> - produces the exact same output as: + îééöøú ôìè äæää ìôìè ùì: </simpara> <informalexample> @@ -931,49 +917,44 @@ </informalexample> <simpara> - i.e. they both produce: <computeroutput>hello world</computeroutput>. + ùúé äãåâîàåú éãôéñå: <computeroutput>hello world</computeroutput>. </simpara> <simpara> - In order to use variable variables with arrays, you have to - resolve an ambiguity problem. That is, if you write - <varname>$$a[1]</varname> then the parser needs to know if you - meant to use <varname>$a[1]</varname> as a variable, or if you - wanted <varname>$$a</varname> as the variable and then the [1] - index from that variable. The syntax for resolving this ambiguity - is: <varname>${$a[1]}</varname> for the first case and - <varname>${$a}[1]</varname> for the second. + ëãé ìäùúîù áùí îùúðä îùúðä òí îòøëéí éù ìôúåø áòééú ëôì + îùîòåú. ëìåîø, ëàùø ëåúáéí <varname>$$a[1]</varname> äîôøù + öøéê ìãòú àí ìäùúîù á- <varname>$a[1]</varname> ëäâãøú ùí ìîùúðä àå + ìäùúîù á- <varname>$$a</varname> ëîùúðä áòì äàéðã÷ñ [1] áîòøê. + äúçáéø ìôúéøú ëôéìåú æå äåà : <varname>${$a[1]}</varname> áî÷øä áøàùåï + å <varname>${$a}[1]</varname> áî÷øä äùðé. </simpara> </sect1> <sect1 id="language.variables.external"> - <title>Variables from outside PHP</title> + <title>îùúðéí îçåõ ì-PHP</title> <sect2 id="language.variables.external.form"> - <title>HTML Forms (GET and POST)</title> + <title>èôñé HTML (GET å POST)</title> <simpara> - When a form is submitted to a PHP script, any variables from that - form will be automatically made available to the script by - PHP. If the <link linkend="ini.track-vars">track_vars</link> - configuration option is turned on, then these variables will be - located in the associative arrays + ëàùø ðùìç èåôñ ìñ÷øéôè PHP , ëì äîùúðéí îèåôñ æä éäéå æîéðéí + áñ÷øéôè. àí ääâãøä ùì <link linkend="ini.track-vars">track_vars</link> + îàåôùøú, îùúðéí àìå éîå÷îå áîòøëéí äàñåöéàèéáéí <varname>$HTTP_POST_VARS</varname>, - <varname>$HTTP_GET_VARS</varname>, and/or - <varname>$HTTP_POST_FILES</varname>, according to the - source of the variable in question. + <varname>$HTTP_GET_VARS</varname>, å\àå + <varname>$HTTP_POST_FILES</varname>, áäúàîä ìî÷åø + äîùúðéí. </simpara> <para> - For more information on these variables, please read <link - linkend="language.variables.predefined">Predefined - variables</link>. + ìîéãò ðåñó áðåùà éù ìòééï áôø÷ <link + linkend="language.variables.predefined">îùúðéí îåâãøéí îøàù</link>. </para> <para> <example> - <title>Simple form variable</title> + <title>îùúðä ôùåè áèåôñ</title> <programlisting role="php"> <![CDATA[ <form action="foo.php" method="post"> @@ -986,35 +967,36 @@ </para> <para> - When the above form is submitted, the value from the text input - will be available in - <varname>$HTTP_POST_VARS['username']</varname>. If the <link + ëàø äèåôñ äð"ì ðùìç, äòøê ùîëéì ùãä äè÷ñè áèåôñ éäéä æîéï + áîùúðä <varname>$HTTP_POST_VARS['username']</varname>. + àí àåôöééú <link linkend="ini.register-globals">register_globals</link> - configuration directive is turned on, then the variable will also - be available as <varname>$username</varname> in the global scope. + îàåôùøú, äîùúðä éåâãø âí ëîùúðä <varname>$username</varname> + ùîåâãø áèååç äîùúðéí äâìåáìé. </para> <note> <para> - The <link linkend="ini.magic-quotes-gpc">magic_quotes_gpc</link> - configuration directive affects Get, Post and Cookie values. If - turned on, value (It's "PHP!") will automagically become (It\'s \"PHP!\"). - Escaping is needed for DB insertion. Also see - <function>addslashes</function>, <function>stripslashes</function> and + ëàùø äåøàú ä÷åðôéâåøöéä <link linkend="ini.magic-quotes-gpc"> + magic_quotes_gpc</link> îàåôùøú, îåùôòéí òøëé îùúðéí ùì GET, POST + åòøëé òåâéåú áàåôï ùòøê ëîå <computeroutput> (It's "PHP!") </computeroutput> + éùúðä áöåøä àåèåîèéú ì <computeroutput>(It\'s \"PHP!\")</computeroutput>. + úäìéê æä ðãøù ìöåøê äëðñú îéãò ìáñéñ ðúåðéí. + éù ìòééï âí áîéãò òì <function>addslashes</function>, <function>stripslashes</function> å- <link linkend="ini.magic-quotes-sybase">magic_quotes_sybase</link>. </para> </note> <simpara> - PHP also understands arrays in the context of form variables - (see the <link linkend="faq.html">related faq</link>). You may, - for example, group related variables together, or use this - feature to retrieve values from a multiple select input: + PHP îáéðä âí úëðé îòøëéí ùì èôñéí. + (éù ìòééï á<link linkend="faq.html">ùàìåú åúùåáåú</link> ìîéãò ðåñó). + àôùø ìîùì ìäùúîù áúëåðä æå òì îðú ìàçã îùúðéí îñåééîéí ì÷áåöåú + àå ì÷ìåè îéãò îúéáú áçéøä øáú àôùøåéåú. </simpara> <para> <example> - <title>More complex form variables</title> + <title>îùúðé èåôñ îåøëáéí</title> <programlisting role="php"> <![CDATA[ <form action="array.php" method="post"> @@ -1034,16 +1016,16 @@ </para> <para> - In PHP 3, the array form variable usage is limited to - single-dimensional arrays. In PHP 4, no such restriction applies. + á- PHP 3 ÷ééîú äâáìä ìîéîã àçã áìáã áîòøëé äèôñéí. + á- PHP 4 ìà ÷ééîú äâáìä ëæå. </para> <sect3 id="language.variables.external.form.submit"> - <title>IMAGE SUBMIT variable names</title> + <title>îùúðé èåôñ ùì ëôúåø ùìéçä âøôé</title> <simpara> - When submitting a form, it is possible to use an image instead - of the standard submit button with a tag like:</simpara> + ðéúï ìäâãéø úîåðä ëëôúåø ùìéçä ùì èåôñ áî÷åí ëôúåø ùìéçä ñèðãøèé: + </simpara> <informalexample> <programlisting role="php"> @@ -1054,37 +1036,34 @@ </informalexample> <simpara> - When the user clicks somewhere on the image, the accompanying - form will be transmitted to the server with two additional - variables, sub_x and sub_y. These contain the coordinates of the - user click within the image. The experienced may note that the - actual variable names sent by the browser contains a period - rather than an underscore, but PHP converts the period to an - underscore automatically. + ëàùø äîùúîù éùìç àú äèåôñ, îùúðé äèåôñ éåòáøå àì äùøú åáðåñó + éåòáøå îùúðéí äîöééðéí àú îé÷åí äìçéöä ùì äòëáø áúîåðä åéåâãøå + ë- <varname>$sub_x</varname> å-<varname>$sub_y</varname>. + éù ìöééï ùùí äîùúðä äî÷åøé îëéì ð÷åãä ùîåîøú ì ÷å-úçúé òì-éãé PHP + áàåôï àåèåîèé. </simpara> </sect3> </sect2> <sect2 id="language.variables.external.cookies"> - <title>HTTP Cookies</title> + <title>òåâéåú HTTP</title> <simpara> - PHP transparently supports HTTP cookies as defined by <ulink - url="&spec.cookies;">Netscape's Spec</ulink>. Cookies are a - mechanism for storing data in the remote browser and thus - tracking or identifying return users. You can set cookies using - the <function>setcookie</function> function. Cookies are part of - the HTTP header, so the SetCookie function must be called before - any output is sent to the browser. This is the same restriction - as for the <function>header</function> function. Any cookies - sent to you from the client will automatically be turned into a - PHP variable just like GET and POST method data.</simpara> + PHP úåîëú áöåøä ù÷åôä áòåâéåú HTTP ìôé äâãøúï á- <ulink + url="&spec.cookies;">Netscape's Spec</ulink>. òåâéåú äï + îðâðåï äîàôùø àâéøú îéãò áãôãôï åòì éãé-ëê îàôùøåú îò÷á àå + æéäåé äîùúîùéí. ðéúï ìäâãéø òåâéä áòæøú äôåð÷öéä <function>setcookie</function>. + òåâéåú äï çì÷ îëåúø ä- (HTTP header) HTTP åìëï ÷øéàä ìôåð÷öéä + <function>setcookie</function> çééáú ìäúáöò ìôðé ùðùìç + ôìè ëìùäå ìãôãôï. äâáìä æää çìä âí òì äôåð÷öéä <function>header</function>. + ëì òåâéä ùðùìçú îäì÷åç äåôëú áàåôï àåèåîèé ìîùúðä PHP áãåîä ìàåôï + äôòåìä áùéîåù á ùéèåú GET å- POST. + </simpara> <simpara> - If you wish to assign multiple values to a single cookie, just - add <emphasis>[]</emphasis> to the cookie name. For - example: + ðéúï ì÷áåò ìòåâéä àçú îñôø òøëéí òì-éãé äåñôú + <emphasis>[]</emphasis> ìùí äòåâéä. ìãåâîä: </simpara> <informalexample> @@ -1096,14 +1075,14 @@ </informalexample> <simpara> - Note that a cookie will replace a previous cookie by the same - name in your browser unless the path or domain is different. So, - for a shopping cart application you may want to keep a counter - and pass this along. i.e. + éù ìöééï ëé òåâéä ùð÷áòä úãøåñ òøëéí ÷åãîéí ùì òåâéä áòìú + ùí æää àìà àí îãåáø áðúéá ùåðä àå ùí domain ùåðä ëê ùìáðééú + àôìé÷öéä ùì òâìú ÷ðéåú, éù öåøê ìäâãéø îåðä åìäòáéøå äìàä. + ìãåâîä: </simpara> <example> - <title>SetCookie Example</title> + <title>ãåâîú SetCookie</title> <programlisting role="php"> <![CDATA[ $Count++; @@ -1116,12 +1095,11 @@ </sect2> <sect2 id="language.variables.external.environment"> - <title>Environment variables</title> + <title>îùúðé ñáéáä</title> <para> - PHP automatically makes environment variables available as normal - PHP variables. - + PHP îâãéøä áàåôï àåèåîèé îùúðé ñáéáä ëîùúðé PHP øâéìéí. + <informalexample> <programlisting role="php"> <![CDATA[ @@ -1132,55 +1110,46 @@ </para> <para> - Since information coming in via GET, POST and Cookie mechanisms - also automatically create PHP variables, it is sometimes best to - explicitly read a variable from the environment in order to make - sure that you are getting the right version. The - <function>getenv</function> function can be used for this. You - can also set an environment variable with the - <function>putenv</function> function. + îàçø ùâí äîéãò äîâéò áòæøú GET, POST åîðâðåï äòåâéåú ðåöø + ëîùúðä PHP øâéì áñ÷øéôè, ìôòîéí òãéó ì÷øåà àú îùúðä äñáéáä äééùø îäñáéáä + ëãé ìååãà ùäú÷áì äòøê îäî÷åø äðëåï. ôåð÷öééú <function>getenv</function> + îùîùú ìöåøê æä. ðéúï âí ì÷áåò îùúðä ñáéáä áòæøú äôåð÷öéä <function>putenv</function>. </para> </sect2> <sect2 id="language.variables.external.dot-in-names"> - <title>Dots in incoming variable names</title> + <title>ð÷åãåú áùîåú îùúðéí ð÷ìèéí</title> <para> - Typically, PHP does not alter the names of variables when they - are passed into a script. However, it should be noted that the - dot (period, full stop) is not a valid character in a PHP - variable name. For the reason, look at it: + áãøê-ëìì PHP ìà úùðä àú ùí äîùúðä äîåòáø ìñ÷øéôè. àåìí, éù ìöééï + ëé úå äð÷åãä àéðå úå ú÷éï áùí îùúðä. îñéáä æå äãåâîä äáàä ìà ú÷éðä: <programlisting role="php"> <![CDATA[ $varname.ext; /* invalid variable name */ ]]> </programlisting> - Now, what the parser sees is a variable named - <varname>$varname</varname>, followed by the string concatenation - operator, followed by the barestring (i.e. unquoted string which - doesn't match any known key or reserved words) 'ext'. Obviously, - this doesn't have the intended result. + áî÷øä æä äîôøù éøàä îùúðä áùí <varname>$varname</varname>, + ùàçøéå àåôåøèåø ìçéáåø îçøåæåú åàçøéå äîéìä 'ext' ùàéðä + îåëøú ëîéìä ùîåøä åçñøú äâãøä ëìùäé. </para> <para> - For this reason, it is important to note that PHP will - automatically replace any dots in incoming variable names with - underscores. + îñéáä æå çùåá ìöééï ùëàùø PHP î÷áìú ùí îùúðä òí ð÷åãä, + äð÷åãä úåçìó á÷å-úçúé. </para> </sect2> <sect2 id="language.variables.determining-type-of"> - <title>Determining variable types</title> + <title>äáçðä áéï ñåâé îùúðéí</title> <para> - Because PHP determines the types of variables and converts them - (generally) as needed, it is not always obvious what type a given - variable is at any one time. PHP includes several functions - which find out what type a variable is. They are + á- PHP àéï äôøãä áéï ñåâé îùúðéí åáãøê-ëìì äúáöòåú äîøåú + ìôé äöåøê åìëï ìà úîéã áøåø îäå ñåâ äîùúðä áëì æîï ðúåï. + á- PHP îñôø ôåð÷öéåú ìîöéàú ñåâ äîùúðä: <function>gettype</function>, <function>is_long</function>, <function>is_double</function>, <function>is_string</function>, - <function>is_array</function>, and + <function>is_array</function>, å- <function>is_object</function>. </para> </sect2>
Index: phpdoc/he/language/variables.xml diff -u phpdoc/he/language/variables.xml:1.1 phpdoc/he/language/variables.xml:1.2 --- phpdoc/he/language/variables.xml:1.1 Tue Feb 5 21:46:20 2002 +++ phpdoc/he/language/variables.xml Thu Feb 7 09:01:56 2002 @@ -2,10 +2,10 @@ <!-- EN-Revision: 1.33 Maintainer: shlomi Status: working --> <chapter id="language.variables"> - <title>Variables</title> + <title>îùúðéí</title> <sect1 id="language.variables.basics"> - <title>Basics</title> + <title>äñáø áñéñé</title> <simpara> îùúðéí á-PHP îéåöâéí òì-éãé ùí òí ñéîï äãåìø áúçéìúå. @@ -366,8 +366,8 @@ <term>$SERVER_SIGNATURE</term> <listitem> <simpara> - String containing the server version and virtual host name - which are added to server-generated pages, if enabled. + îçøåæú äîëéìä àú âøñú äùøú åùí ä-host äåéøèåàìé. äîçøåæú úöåøó + ìãôéí äðåöøéí òì-éãé äùøú àí àåôöéä æå îàåôùøú. </simpara> </listitem> </varlistentry> @@ -410,65 +410,62 @@ <title>îùúðé ñáéáä</title> <simpara> - These variables are imported into PHP's global namespace from the - environment under which the PHP parser is running. Many are - provided by the shell under which PHP is running and different - systems are likely running different kinds of shells, a - definitive list is impossible. Please see your shell's - documentation for a list of defined environment variables. + îùúðéí àìå îéåáàéí îäñáéáä ùúçúéä øõ îôøù ä-PHP + ìúåê îùúðéí âìåáìéí áñ÷øéôè. øáéí îäí îéåáàéí îúåëðéåú + äîòèôú (shell) ùúçúéä øöä PHP åëàùø îùúîùéí á-PHP áîòøëåú + ùåðåú åáúåëðéåú îòèôú ùåðåú, ìà ðéúï ìúòã øùéîä àçéãä ùì + îùúðéí àìå. éù ìòééï áúéòåã úåëðú äîòèôú ì÷áìú øùéîä ùì îùúðé äñáéáä. </simpara> <simpara> - Other environment variables include the CGI variables, placed - there regardless of whether PHP is running as a server module or - CGI processor. + îùúðé ñáéáä àçãéí éëììå àú îùúðé ä-CGI äîîå÷îéí ùí ëàùø PHP øöä + ëîåãåì ùøú åâí ëàùø PHP øöä ëîòáã CGI. </simpara> </sect2> <sect2 id="language.variables.predefined.php"> - <title>PHP variables</title> + <title>îùúðé-PHP</title> <simpara> - These variables are created by PHP itself. The - <varname>$HTTP_*_VARS</varname> variables are available only if - the <link linkend="ini.track-vars">track_vars</link> - configuration is turned on. When enabled, the variables are - always set, even if they are empty arrays. This prevents - a malicious user from spoofing these variables. + îùúðéí àìå ðåöøéí òì-éãé PHP. ëì äîùúðéí áöåøú + <varname>$HTTP_*_VARS</varname> éäéå æîéðéí ø÷ àí äàåôöéä + <link linkend="ini.track-vars">track_vars</link> îàåôùøú. + ëàùø àåôöéä æå îàåôùøú, îùúðéí àìå úîéãéåâãøå, àôéìå + àí éåâãøå ëîòøëéí øé÷éí ëãé ìîðåò îîùúîù áòì ëååðú æãåï + ìùðåú àú òøëí. </simpara> <note> <para> - As of PHP 4.0.3, <link - linkend="ini.track-vars">track_vars</link> is always turned on, - regardless of the configuration file setting. + äçì îâøñä 4.0.3 ùì PHP äàåôöéä <link + linkend="ini.track-vars">track_vars</link> úîéã ôòéìä + ììà äúçùáåú áäâãøúä á÷åáõ ääâãøåú ùì PHP. </para> </note> <note> <para> - The new "Superglobals" were added in PHP version 4.1.0. See the - <ulink url="&url.php.release4.1.0;">4.1.0 Release - Announcement</ulink> for more details. These are the + ðåñôå îùúðéí "ñåôø-âìåáìéí" çãùéí îâøñä 4.1.0 . éù ìòééï + á<ulink url="&url.php.release4.1.0;">äëøæä ùì PHP 4.1.0 </ulink> + ìîéãò ðåñó. äîùúðéí äçãùéí <varname>$_GET</varname>, <varname>$_POST</varname>, <varname>$_ENV</varname>, <varname>$_SERVER</varname>, <varname>$_COOKIE</varname>, <varname>$_REQUEST</varname> <varname>$_FILES</varname>, and <varname>$_SESSION</varname> - arrays, and they are informally known as - <emphasis>Superglobals</emphasis> since they are always - available without regard to scope. These deprecate the older - respective <varname>$HTTP_*_VARS</varname> arrays. + äí îòøëéí ùîåâãøéí ë"ñåôø-âìåáìéí" îàçø ùäí æîéðéí úîéã ììà úìåú + áèååç äâãøú äðúåðéí (scope). + îùúðéí àìå îçìéôéí àú îòøëé ä-<varname>$HTTP_*_VARS</varname> + ùäéå áòáø áùéîåù. </para> </note> <para> - If the <link - linkend="ini.register-globals">register_globals</link> directive - is set, then these variables will also be made available in the - global scope of the script; i.e., separate from the - <varname>$HTTP_*_VARS</varname> and <varname>$_*</varname> - arrays. For related information, see the security chapter titled - <link linkend="security.registerglobals">Using Register Globals</link>. + àí àåôöééú <link + linkend="ini.register-globals">register_globals</link> îàåôùøú, + éäéå îùúðéí àìå æîéðéí âí ëï áèååç äîùúðéí äâìåáìéí áðôøã îîòøëé + ä-<varname>$HTTP_*_VARS</varname> äå-<varname>$_*</varname>. + ìîéãò ðåñó, éù ìòééï áôø÷ àáèçú äîéãò ùëåúøúå <link + linkend="security.registerglobals">àåôï äùéîåù áøéùåí âìåáìéí</link>. </para> <para> @@ -477,10 +474,10 @@ <term>$argv</term> <listitem> <simpara> - Array of arguments passed to the script. When the script is - run on the command line, this gives C-style access to the - command line parameters. When called via the GET method, this - will contain the query string. + îòøê äîëéì àú øùéîú äàøâåîðèéí äîåòáøéí ìñ÷øéôè. áòú äøöú + ñ÷øéôè îùåøú äô÷åãä, îòøê æä îàôùø âéùä áñâðåï ùôú C ìôøîèøéí + îùåøú äô÷åãä. ëàùø òîåã î÷áì ôðééä áùéèú GET , îùúðä æä éëéì + àú ä-query string. </simpara> </listitem> </varlistentry> @@ -489,8 +486,8 @@ <term>$argc</term> <listitem> <simpara> - Contains the number of command line parameters passed to the - script (if run on the command line). + îëéì àú îñôø äôøîèøéí äîåòáøéí áàîöòåú ùåøú äô÷åãä ìñ÷øéôè + (àí äñ÷øéôè îåøõ îùåøú äô÷åãä). </simpara> </listitem> </varlistentry> @@ -499,9 +496,8 @@ <term>$PHP_SELF</term> <listitem> <simpara> - The filename of the currently executing script, relative to - the document root. If PHP is running as a command-line - processor, this variable is not available. + ùí ä÷åáõ ùì äñ÷øéôè äðåëçé, éçñéú ìñôøééä äøàùéú ùì äòîåã. + àí PHP îåøöú áùåøú äô÷åãä, îùúðä æä àéðå æîéï. </simpara> </listitem> </varlistentry> @@ -510,8 +506,8 @@ <term>$HTTP_COOKIE_VARS</term> <listitem> <simpara> - An associative array of variables passed to the current - script via HTTP cookies. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + ãøê òåâéåú HTTP. </simpara> </listitem> </varlistentry> @@ -520,9 +516,10 @@ <term>$_COOKIE</term> <listitem> <simpara> - An associative array of variables passed to the current - script via HTTP cookies. Automatically global in any - scope. Introduced in PHP 4.1.0. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + ãøê òåâéåú HTTP. + îùúðä æä îåâãø áëì èååç îùúðéí ëìùäå. + ðåñó ì-PHP äçì îâøñä 4.1.0 . </simpara> </listitem> </varlistentry> @@ -531,8 +528,8 @@ <term>$HTTP_GET_VARS</term> <listitem> <simpara> - An associative array of variables passed to the current - script via the HTTP GET method. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + ãøê ùéèú HTTP GET. </simpara> </listitem> </varlistentry> @@ -541,9 +538,10 @@ <term>$_GET</term> <listitem> <simpara> - An associative array of variables passed to the current - script via the HTTP GET method. Automatically global in - any scope. Introduced in PHP 4.1.0. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + ãøê ùéèú HTTP GET. + îùúðä æä îåâãø áëì èååç îùúðéí ëìùäå. + ðåñó ì-PHP äçì îâøñä 4.1.0 . </simpara> </listitem> </varlistentry> @@ -552,8 +550,8 @@ <term>$HTTP_POST_VARS</term> <listitem> <simpara> - An associative array of variables passed to the current - script via the HTTP POST method. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + ãøê ùéèú HTTP POST. </simpara> </listitem> </varlistentry> @@ -562,9 +560,10 @@ <term>$_POST</term> <listitem> <simpara> - An associative array of variables passed to the current - script via the HTTP POST method. Automatically global in - any scope. Introduced in PHP 4.1.0. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + ãøê ùéèú HTTP POST. + îùúðä æä îåâãø áëì èååç îùúðéí ëìùäå. + ðåñó ì-PHP äçì îâøñä 4.1.0 . </simpara> </listitem> </varlistentry> @@ -573,11 +572,11 @@ <term>$HTTP_POST_FILES</term> <listitem> <simpara> - An associative array of variables containing information - about files uploaded via the HTTP POST method. See <link - linkend="features.file-upload.post-method">POST method - uploads</link> for information on the contents of - <varname>$HTTP_POST_FILES</varname>. Introduced in 4.0.0. + îòøê àñåöéàèéáé ùì îùúðéí äîëéìéí îéãò òì ÷áöéí ùäåòìå ìùøú + áùéèú HTTP POST. éù ìòééï á<link + linkend="features.file-upload.post-method">äòìàú ÷áöéí + áùéèú POST</link> ìîéãò òì úëåìúå ùì <varname>$HTTP_POST_FILES</varname>. + ðåñó ì-PHP äçì îâøñä 4.0.0. </simpara> </listitem> </varlistentry> @@ -586,12 +585,12 @@ <term>$_FILES</term> <listitem> <simpara> - An associative array of variables containing information - about files uploaded via the HTTP POST method. See <link - linkend="features.file-upload.post-method">POST method - uploads</link> for information on the contents of - <varname>$_FILES</varname>. Automatically global in any scope. - Introduced in PHP 4.1.0. + îòøê àñåöéàèéáé ùì îùúðéí äîëéìéí îéãò òì ÷áöéí ùäåòìå ìùøú + áùéèú HTTP POST. éù ìòééï á<link + linkend="features.file-upload.post-method">äòìàú ÷áöéí + áùéèú POST</link> ìîéãò òì úëåìúå ùì <varname>$_FILES</varname>. + îùúðä æä îåâãø áëì èååç îùúðéí ëìùäå. + ðåñó ì-PHP äçì îâøñä 4.1.0 . </simpara> </listitem> </varlistentry> @@ -600,8 +599,8 @@ <term>$HTTP_ENV_VARS</term> <listitem> <simpara> - An associative array of variables passed to the current - script via the parent environment. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + îñáéáú äàá. </simpara> </listitem> </varlistentry> @@ -610,9 +609,10 @@ <term>$_ENV</term> <listitem> <simpara> - An associative array of variables passed to the current - script via the parent environment. Automagically global - in any scope. Introduced in PHP 4.1.0. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + îñáéáú äàá. + îùúðä æä îåâãø áëì èååç îùúðéí ëìùäå. + ðåñó ì-PHP äçì îâøñä 4.1.0 . </simpara> </listitem> </varlistentry> @@ -621,9 +621,8 @@ <term>$HTTP_SERVER_VARS</term> <listitem> <simpara> - An associative array of variables passed to the current - script from the HTTP server. These variables are analogous to - the Apache variables described above. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + îäùøú. òøëéí àìå î÷áéìéí ìîùúðé ùøú Apache äîúåàøéí ìîòìä. </simpara> </listitem> </varlistentry> @@ -632,10 +631,10 @@ <term>$_SERVER</term> <listitem> <simpara> - An associative array of variables passed to the current - script from the HTTP server. These variables are analogous to - the Apache variables described above. Automatically global - in any scope. Introduced in PHP 4.1.0. + îòøê àñåöéàèéáé ùì äîùúðéí äîåòáøéí ìñ÷øéôè äðåëçé + îäùøú. òøëéí àìå î÷áéìéí ìîùúðé ùøú Apache äîúåàøéí ìîòìä. + îùúðä æä îåâãø áëì èååç îùúðéí ëìùäå. + ðåñó ì-PHP äçì îâøñä 4.1.0 . </simpara> </listitem> </varlistentry> @@ -644,8 +643,7 @@ <term>$HTTP_SESSION_VARS</term> <listitem> <simpara> - An associative array of session variables passed to the current - script. + îòøê àñåöéàèéáé äîëéì àú îùúðé ä-session äîåòáøéí ìñ÷øéôè äðåëçé. </simpara> </listitem> </varlistentry> @@ -654,11 +652,12 @@ <term>$_SESSION</term> <listitem> <simpara> - An associative array of session variables passed to the - current script. Automatically global in any scope. Creating - new entries in the $_SESSION array will automatically - register them as session variables, as if you called - <function>session_register</function>. Introduced in PHP 4.1.0. + îòøê àñåöéàèéáé äîëéì àú îùúðé ä-session äîåòáøéí ìñ÷øéôè äðåëçé. + îùúðä æä îåâãø áëì èååç îùúðéí ëìùäå. + éöéøú úàéí çãùéí áîòøê æä úâøåí ìøéùåí àåèåîèé ùì ðúåðéí àìå + ëîùúðé session áãåîä ìôòåìä äîúáöòú áòú ÷øéàä ìôåð÷öéä + <function>session_register</function>. + ðåñó ì-PHP äçì îâøñä 4.1.0 . </simpara> </listitem> </varlistentry> @@ -667,10 +666,10 @@ <term>$_REQUEST</term> <listitem> <simpara> - An associative array merged from the GET, POST, and Cookie variables. - In other words - all the information that is coming from the user, - and that from a security point of view, cannot be trusted. - Automatically global in any scope. Introduced in PHP 4.1.0. + îòøê àñåöéàèéáé äîîæâ àú ëì äîéãò îîùúðé GET, POST å-Cookie . + áîéìéí àçøåú, äåà îëéì àú ëì äîéãò äîâéò îäîùúîù åîáçéðú àáèçú îéãò + àéðå îåîìõ ìùéîåù ëé ìà ðéúï ìáèåç áîéãò æä. + ðåñó ì-PHP äçì îâøñä 4.1.0 . </simpara> </listitem> </varlistentry> @@ -684,13 +683,12 @@ <sect1 id="language.variables.scope"> - <title>Variable scope</title> + <title>èååç ääâãøä ùì îùúðéí</title> <simpara> - The scope of a variable is the context within which it is defined. - For the most part all PHP variables only have a single scope. - This single scope spans included and required files as well. For - example: + èååç ääâãøä ùì îùúðä äåà ä÷åðè÷ñè ùáå äîùúðä îåâãø. + ìëì îùúðé PHP éù èååç äâãøä àçã áìáã. + èååç æä ëåìì âí ÷áöéí îñåôçéí.ìãåâîä: </simpara> <informalexample> <programlisting role="php"> @@ -701,11 +699,10 @@ </programlisting> </informalexample> <simpara> - Here the <varname>$a</varname> variable will be available within - the included <filename>b.inc</filename> script. However, within - user-defined functions a local function scope is introduced. Any - variable used inside a function is by default limited to the local - function scope. For example: + äîùúðä <varname>$a</varname> éäéä îåâãø âí á÷åáõ äîñåôç-<filename>b.inc</filename>. + ìòåîú æàú, áôåð÷öéä ùäåâãøä òì-éãé äîùúîù ÷ééí èååç äâãøä ìå÷àìé. + ëì îùúðä áúåê äôåð÷öéä îåâãø áèååç äôåð÷öéä áìáã ëáøéøú îçãì. + ìãåâîä: </simpara> <informalexample> @@ -724,16 +721,13 @@ </informalexample> <simpara> - This script will not produce any output because the echo statement - refers to a local version of the <varname>$a</varname> variable, - and it has not been assigned a value within this scope. You may - notice that this is a little bit different from the C language in - that global variables in C are automatically available to - functions unless specifically overridden by a local definition. - This can cause some problems in that people may inadvertently - change a global variable. In PHP global variables must be - declared global inside a function if they are going to be used in - that function. An example: + ñ÷øéôè æä ìà éãôéñ ÷ìè ëé ô÷åãú ä-echo îúééçñú ìâøñä äìå÷àìéú ùì + äîùúðä <varname>$a</varname>, åîùúðä æä ìà ÷éáì äöáä áèååç äâãøúå. + ðéúï ìøàåú ùäúðäâåú æå ùåðä áî÷öú îäúðäâåú ùôú C áëê ùîùúðéí âìåáìéí + áùôú C æîéðéí àåèåîèéú âí áôåð÷öéåú àìà àí ðãøñå òì-éãé äâãøä ìå÷àìéú. + úúëï áòéä ëàùø úëðú éðñä ììà äöìçä éúøä ìùðåú àú òøëå ùì îùúðä âìåáìé + îúåê ôåð÷öéä. îùúðä âìåáìé á-PHP çééá ìäéåú îåöäø ëîùúðä âìåáìé àí + ÷ééîú ëååðä ìäùúîù áîùúðä æä îúåê äôåð÷öéä. ãåâîä: </simpara> <informalexample> @@ -756,17 +750,16 @@ </informalexample> <simpara> - The above script will output "3". By declaring - <varname>$a</varname> and <varname>$b</varname> global within the - function, all references to either variable will refer to the - global version. There is no limit to the number of global - variables that can be manipulated by a function. + äñ÷øéôè éãôéñ "3". ëàùø äîùúðéí <varname>$a</varname> å- <varname>$b</varname> + îåâãøéí ëâìåáìéí áôåð÷öéä, ëì äúééçñåú àìéäí úúéçñ ìâøñä äâìåáìéú + ùìäí. àéï äâáìä ìîñôø äîùúðéí äâìåáìéí ùôåð÷öéä + éëåìä ìùðåú. </simpara> <simpara> - A second way to access variables from the global scope is to use - the special PHP-defined <varname>$GLOBALS</varname> array. The - previous example can be rewritten as: + + ãøê ðåñôú ìâùú èååç äîùúðéí äâìåáìéí äéà áòæøú äîòøê äîåâãø îøàù- + <varname>$GLOBALS</varname>. àôùø ìëúåá àú äãåâîä ä÷åãîú âí áöåøä äæå: </simpara> <informalexample> @@ -787,17 +780,15 @@ </informalexample> <simpara> - The <varname>$GLOBALS</varname> array is an associative array with - the name of the global variable being the key and the contents of - that variable being the value of the array element. + äîòøê <varname>$GLOBALS</varname> äåà îòøê àñåöéàèéáé áàåôï + ùùí äîùúðä äâìåáìé äåà äîôúç ìòøê åòøê äîùúðä äâìåáìé äåà + äòøê ùì úà æä áîòøê. </simpara> <simpara> - Another important feature of variable scoping is the - <emphasis>static</emphasis> variable. A static variable exists - only in a local function scope, but it does not lose its value - when program execution leaves this scope. Consider the following - example: + úëåðä ðåñôú ùéù ìöééï àú çùéáåúä äéà äîùúðä ä<emphasis>ñèàèé</emphasis>. + îùúðä ñèàèé ÷ééí ø÷ áèååç ìå÷àìé ùì ôåð÷öéä àê àéðå îàáã + àú òøëå ìàçø ñéåí äøöú äôåð÷öéä. ìãåâîä: </simpara> <informalexample> @@ -814,13 +805,12 @@ </informalexample> <simpara> - This function is quite useless since every time it is called it - sets <varname>$a</varname> to <literal>0</literal> and prints - "0". The <varname>$a</varname>++ which increments the - variable serves no purpose since as soon as the function exits the - <varname>$a</varname> variable disappears. To make a useful - counting function which will not lose track of the current count, - the <varname>$a</varname> variable is declared static: + ôåð÷öéä æå äéà çñøú úåòìú ìçìåèéï ëé áëì ÷øéàä ìôåð÷öéä, îúàôñ + òøëå ùì äîùúðä <varname>$a</varname> åäôåð÷öéä úãôéñ "0". + ôòåìú ä- <varname>$a++</varname> ìà îùøúú ùåí îèøä ëé ìàçø äéöéàä îäôåð÷öéä, + äîùúðä <varname>$a</varname> ðòìí. ëãé ìééöø ôåð÷öéú ñôéøä + ùéîåùéú àñåø ìðå ìàáã àú äòøê äðåëçé ùì <varname>$a</varname> åìëï + îùúðä æä îåâãø ëîùúðä ñèàèé: </simpara> <informalexample> @@ -837,18 +827,16 @@ </informalexample> <simpara> - Now, every time the Test() function is called it will print the - value of <varname>$a</varname> and increment it. + òëùéå, áëì ÷øéàä ìôåð÷öéä Test, éåãôñ òøëå ùì äîùúðä <varname>$a</varname> + åàçø-ëê éåâãì òøëå. </simpara> <simpara> - Static variables also provide one way to deal with recursive - functions. A recursive function is one which calls itself. Care - must be taken when writing a recursive function because it is - possible to make it recurse indefinitely. You must make sure you - have an adequate way of terminating the recursion. The following - simple function recursively counts to 10, using the static - variable <varname>$count</varname> to know when to stop: + àôùø ìäùúîù áîùúðä ñèàèé âí ìöåøê èéôåì áôåð÷öéåú ø÷åøñéáéåú. + ôåð÷öéä ø÷åøñéáéú äéà ôåð÷öéä ù÷åøàú ìòöîä. áëúéáú ôåð÷öéåú ø÷åøñéáéåú éù ìùéí ìá + áëúéáú úðàé äôñ÷ä îúàéí àçøú éååöø îöá ùäôåð÷öéä úøåõ áàåôï àéðñåôé. + äôåð÷öéä äø÷åøñéáéú äáàä ôùåè ñåôøú òã 10 úåê ùéîåù áîùúðä ñèàèé- + <varname>$count</varname> ëãé ìãòú îúé ìòöåø: </simpara> <informalexample> @@ -872,12 +860,12 @@ </sect1> <sect1 id="language.variables.variable"> - <title>Variable variables</title> + <title>ùîåú îùúðéí ùîùúðéí</title> <simpara> - Sometimes it is convenient to be able to have variable variable - names. That is, a variable name which can be set and used - dynamically. A normal variable is set with a statement such as: + ìòéúéí æä ðåç ìäùúîù áùîåú îùúðéí - îùúðéí. ëìåîø, ùí îùúðä + éëåì ìä÷áò òì-éãé äúåëðéú áöåøä ãéðàîéú. îùúðä øâéì î÷áì äöáä + áàîöòåú ô÷åãä ëâåï: </simpara> <informalexample> @@ -889,10 +877,9 @@ </informalexample> <simpara> - A variable variable takes the value of a variable and treats that - as the name of a variable. In the above example, - <emphasis>hello</emphasis>, can be used as the name of a variable - by using two dollar signs. i.e. + îùúðä ùùîå îùúðä ìå÷ç àú äòøê ùì äîùúðä åîúééçñ àìéå ëàì ùí îùúðä. + áãåâîä ä÷åãîú, äîçøåæú <emphasis>hello</emphasis> éëåìä ìùîù âí ëùí + îùúðä òì-éãé ùéîåù áùðé ñéîðé ãåìø: </simpara> <informalexample> @@ -904,10 +891,9 @@ </informalexample> <simpara> - At this point two variables have been defined and stored in the - PHP symbol tree: <varname>$a</varname> with contents "hello" and - <varname>$hello</varname> with contents "world". Therefore, this - statement: + áð÷åãä æå îåâãøéí ùðé îùúðéí áèáìú äñîìéí ùì PHP. äîùúðä <varname>$a</varname> + ùòøëå "hello" åäîùúðä <varname>$hello</varname> ùòøëå "world". + ëôåòì éåöà, äô÷åãä: </simpara> <informalexample> @@ -919,7 +905,7 @@ </informalexample> <simpara> - produces the exact same output as: + îééöøú ôìè äæää ìôìè ùì: </simpara> <informalexample> @@ -931,49 +917,44 @@ </informalexample> <simpara> - i.e. they both produce: <computeroutput>hello world</computeroutput>. + ùúé äãåâîàåú éãôéñå: <computeroutput>hello world</computeroutput>. </simpara> <simpara> - In order to use variable variables with arrays, you have to - resolve an ambiguity problem. That is, if you write - <varname>$$a[1]</varname> then the parser needs to know if you - meant to use <varname>$a[1]</varname> as a variable, or if you - wanted <varname>$$a</varname> as the variable and then the [1] - index from that variable. The syntax for resolving this ambiguity - is: <varname>${$a[1]}</varname> for the first case and - <varname>${$a}[1]</varname> for the second. + ëãé ìäùúîù áùí îùúðä îùúðä òí îòøëéí éù ìôúåø áòééú ëôì + îùîòåú. ëìåîø, ëàùø ëåúáéí <varname>$$a[1]</varname> äîôøù + öøéê ìãòú àí ìäùúîù á- <varname>$a[1]</varname> ëäâãøú ùí ìîùúðä àå + ìäùúîù á- <varname>$$a</varname> ëîùúðä áòì äàéðã÷ñ [1] áîòøê. + äúçáéø ìôúéøú ëôéìåú æå äåà : <varname>${$a[1]}</varname> áî÷øä áøàùåï + å <varname>${$a}[1]</varname> áî÷øä äùðé. </simpara> </sect1> <sect1 id="language.variables.external"> - <title>Variables from outside PHP</title> + <title>îùúðéí îçåõ ì-PHP</title> <sect2 id="language.variables.external.form"> - <title>HTML Forms (GET and POST)</title> + <title>èôñé HTML (GET å POST)</title> <simpara> - When a form is submitted to a PHP script, any variables from that - form will be automatically made available to the script by - PHP. If the <link linkend="ini.track-vars">track_vars</link> - configuration option is turned on, then these variables will be - located in the associative arrays + ëàùø ðùìç èåôñ ìñ÷øéôè PHP , ëì äîùúðéí îèåôñ æä éäéå æîéðéí + áñ÷øéôè. àí ääâãøä ùì <link linkend="ini.track-vars">track_vars</link> + îàåôùøú, îùúðéí àìå éîå÷îå áîòøëéí äàñåöéàèéáéí <varname>$HTTP_POST_VARS</varname>, - <varname>$HTTP_GET_VARS</varname>, and/or - <varname>$HTTP_POST_FILES</varname>, according to the - source of the variable in question. + <varname>$HTTP_GET_VARS</varname>, å\àå + <varname>$HTTP_POST_FILES</varname>, áäúàîä ìî÷åø + äîùúðéí. </simpara> <para> - For more information on these variables, please read <link - linkend="language.variables.predefined">Predefined - variables</link>. + ìîéãò ðåñó áðåùà éù ìòééï áôø÷ <link + linkend="language.variables.predefined">îùúðéí îåâãøéí îøàù</link>. </para> <para> <example> - <title>Simple form variable</title> + <title>îùúðä ôùåè áèåôñ</title> <programlisting role="php"> <![CDATA[ <form action="foo.php" method="post"> @@ -986,35 +967,36 @@ </para> <para> - When the above form is submitted, the value from the text input - will be available in - <varname>$HTTP_POST_VARS['username']</varname>. If the <link + ëàø äèåôñ äð"ì ðùìç, äòøê ùîëéì ùãä äè÷ñè áèåôñ éäéä æîéï + áîùúðä <varname>$HTTP_POST_VARS['username']</varname>. + àí àåôöééú <link linkend="ini.register-globals">register_globals</link> - configuration directive is turned on, then the variable will also - be available as <varname>$username</varname> in the global scope. + îàåôùøú, äîùúðä éåâãø âí ëîùúðä <varname>$username</varname> + ùîåâãø áèååç äîùúðéí äâìåáìé. </para> <note> <para> - The <link linkend="ini.magic-quotes-gpc">magic_quotes_gpc</link> - configuration directive affects Get, Post and Cookie values. If - turned on, value (It's "PHP!") will automagically become (It\'s \"PHP!\"). - Escaping is needed for DB insertion. Also see - <function>addslashes</function>, <function>stripslashes</function> and + ëàùø äåøàú ä÷åðôéâåøöéä <link linkend="ini.magic-quotes-gpc"> + magic_quotes_gpc</link> îàåôùøú, îåùôòéí òøëé îùúðéí ùì GET, POST + åòøëé òåâéåú áàåôï ùòøê ëîå <computeroutput> (It's "PHP!") </computeroutput> + éùúðä áöåøä àåèåîèéú ì <computeroutput>(It\'s \"PHP!\")</computeroutput>. + úäìéê æä ðãøù ìöåøê äëðñú îéãò ìáñéñ ðúåðéí. + éù ìòééï âí áîéãò òì <function>addslashes</function>, <function>stripslashes</function> å- <link linkend="ini.magic-quotes-sybase">magic_quotes_sybase</link>. </para> </note> <simpara> - PHP also understands arrays in the context of form variables - (see the <link linkend="faq.html">related faq</link>). You may, - for example, group related variables together, or use this - feature to retrieve values from a multiple select input: + PHP îáéðä âí úëðé îòøëéí ùì èôñéí. + (éù ìòééï á<link linkend="faq.html">ùàìåú åúùåáåú</link> ìîéãò ðåñó). + àôùø ìîùì ìäùúîù áúëåðä æå òì îðú ìàçã îùúðéí îñåééîéí ì÷áåöåú + àå ì÷ìåè îéãò îúéáú áçéøä øáú àôùøåéåú. </simpara> <para> <example> - <title>More complex form variables</title> + <title>îùúðé èåôñ îåøëáéí</title> <programlisting role="php"> <![CDATA[ <form action="array.php" method="post"> @@ -1034,16 +1016,16 @@ </para> <para> - In PHP 3, the array form variable usage is limited to - single-dimensional arrays. In PHP 4, no such restriction applies. + á- PHP 3 ÷ééîú äâáìä ìîéîã àçã áìáã áîòøëé äèôñéí. + á- PHP 4 ìà ÷ééîú äâáìä ëæå. </para> <sect3 id="language.variables.external.form.submit"> - <title>IMAGE SUBMIT variable names</title> + <title>îùúðé èåôñ ùì ëôúåø ùìéçä âøôé</title> <simpara> - When submitting a form, it is possible to use an image instead - of the standard submit button with a tag like:</simpara> + ðéúï ìäâãéø úîåðä ëëôúåø ùìéçä ùì èåôñ áî÷åí ëôúåø ùìéçä ñèðãøèé: + </simpara> <informalexample> <programlisting role="php"> @@ -1054,37 +1036,34 @@ </informalexample> <simpara> - When the user clicks somewhere on the image, the accompanying - form will be transmitted to the server with two additional - variables, sub_x and sub_y. These contain the coordinates of the - user click within the image. The experienced may note that the - actual variable names sent by the browser contains a period - rather than an underscore, but PHP converts the period to an - underscore automatically. + ëàùø äîùúîù éùìç àú äèåôñ, îùúðé äèåôñ éåòáøå àì äùøú åáðåñó + éåòáøå îùúðéí äîöééðéí àú îé÷åí äìçéöä ùì äòëáø áúîåðä åéåâãøå + ë- <varname>$sub_x</varname> å-<varname>$sub_y</varname>. + éù ìöééï ùùí äîùúðä äî÷åøé îëéì ð÷åãä ùîåîøú ì ÷å-úçúé òì-éãé PHP + áàåôï àåèåîèé. </simpara> </sect3> </sect2> <sect2 id="language.variables.external.cookies"> - <title>HTTP Cookies</title> + <title>òåâéåú HTTP</title> <simpara> - PHP transparently supports HTTP cookies as defined by <ulink - url="&spec.cookies;">Netscape's Spec</ulink>. Cookies are a - mechanism for storing data in the remote browser and thus - tracking or identifying return users. You can set cookies using - the <function>setcookie</function> function. Cookies are part of - the HTTP header, so the SetCookie function must be called before - any output is sent to the browser. This is the same restriction - as for the <function>header</function> function. Any cookies - sent to you from the client will automatically be turned into a - PHP variable just like GET and POST method data.</simpara> + PHP úåîëú áöåøä ù÷åôä áòåâéåú HTTP ìôé äâãøúï á- <ulink + url="&spec.cookies;">Netscape's Spec</ulink>. òåâéåú äï + îðâðåï äîàôùø àâéøú îéãò áãôãôï åòì éãé-ëê îàôùøåú îò÷á àå + æéäåé äîùúîùéí. ðéúï ìäâãéø òåâéä áòæøú äôåð÷öéä <function>setcookie</function>. + òåâéåú äï çì÷ îëåúø ä- (HTTP header) HTTP åìëï ÷øéàä ìôåð÷öéä + <function>setcookie</function> çééáú ìäúáöò ìôðé ùðùìç + ôìè ëìùäå ìãôãôï. äâáìä æää çìä âí òì äôåð÷öéä <function>header</function>. + ëì òåâéä ùðùìçú îäì÷åç äåôëú áàåôï àåèåîèé ìîùúðä PHP áãåîä ìàåôï + äôòåìä áùéîåù á ùéèåú GET å- POST. + </simpara> <simpara> - If you wish to assign multiple values to a single cookie, just - add <emphasis>[]</emphasis> to the cookie name. For - example: + ðéúï ì÷áåò ìòåâéä àçú îñôø òøëéí òì-éãé äåñôú + <emphasis>[]</emphasis> ìùí äòåâéä. ìãåâîä: </simpara> <informalexample> @@ -1096,14 +1075,14 @@ </informalexample> <simpara> - Note that a cookie will replace a previous cookie by the same - name in your browser unless the path or domain is different. So, - for a shopping cart application you may want to keep a counter - and pass this along. i.e. + éù ìöééï ëé òåâéä ùð÷áòä úãøåñ òøëéí ÷åãîéí ùì òåâéä áòìú + ùí æää àìà àí îãåáø áðúéá ùåðä àå ùí domain ùåðä ëê ùìáðééú + àôìé÷öéä ùì òâìú ÷ðéåú, éù öåøê ìäâãéø îåðä åìäòáéøå äìàä. + ìãåâîä: </simpara> <example> - <title>SetCookie Example</title> + <title>ãåâîú SetCookie</title> <programlisting role="php"> <![CDATA[ $Count++; @@ -1116,12 +1095,11 @@ </sect2> <sect2 id="language.variables.external.environment"> - <title>Environment variables</title> + <title>îùúðé ñáéáä</title> <para> - PHP automatically makes environment variables available as normal - PHP variables. - + PHP îâãéøä áàåôï àåèåîèé îùúðé ñáéáä ëîùúðé PHP øâéìéí. + <informalexample> <programlisting role="php"> <![CDATA[ @@ -1132,55 +1110,46 @@ </para> <para> - Since information coming in via GET, POST and Cookie mechanisms - also automatically create PHP variables, it is sometimes best to - explicitly read a variable from the environment in order to make - sure that you are getting the right version. The - <function>getenv</function> function can be used for this. You - can also set an environment variable with the - <function>putenv</function> function. + îàçø ùâí äîéãò äîâéò áòæøú GET, POST åîðâðåï äòåâéåú ðåöø + ëîùúðä PHP øâéì áñ÷øéôè, ìôòîéí òãéó ì÷øåà àú îùúðä äñáéáä äééùø îäñáéáä + ëãé ìååãà ùäú÷áì äòøê îäî÷åø äðëåï. ôåð÷öééú <function>getenv</function> + îùîùú ìöåøê æä. ðéúï âí ì÷áåò îùúðä ñáéáä áòæøú äôåð÷öéä <function>putenv</function>. </para> </sect2> <sect2 id="language.variables.external.dot-in-names"> - <title>Dots in incoming variable names</title> + <title>ð÷åãåú áùîåú îùúðéí ð÷ìèéí</title> <para> - Typically, PHP does not alter the names of variables when they - are passed into a script. However, it should be noted that the - dot (period, full stop) is not a valid character in a PHP - variable name. For the reason, look at it: + áãøê-ëìì PHP ìà úùðä àú ùí äîùúðä äîåòáø ìñ÷øéôè. àåìí, éù ìöééï + ëé úå äð÷åãä àéðå úå ú÷éï áùí îùúðä. îñéáä æå äãåâîä äáàä ìà ú÷éðä: <programlisting role="php"> <![CDATA[ $varname.ext; /* invalid variable name */ ]]> </programlisting> - Now, what the parser sees is a variable named - <varname>$varname</varname>, followed by the string concatenation - operator, followed by the barestring (i.e. unquoted string which - doesn't match any known key or reserved words) 'ext'. Obviously, - this doesn't have the intended result. + áî÷øä æä äîôøù éøàä îùúðä áùí <varname>$varname</varname>, + ùàçøéå àåôåøèåø ìçéáåø îçøåæåú åàçøéå äîéìä 'ext' ùàéðä + îåëøú ëîéìä ùîåøä åçñøú äâãøä ëìùäé. </para> <para> - For this reason, it is important to note that PHP will - automatically replace any dots in incoming variable names with - underscores. + îñéáä æå çùåá ìöééï ùëàùø PHP î÷áìú ùí îùúðä òí ð÷åãä, + äð÷åãä úåçìó á÷å-úçúé. </para> </sect2> <sect2 id="language.variables.determining-type-of"> - <title>Determining variable types</title> + <title>äáçðä áéï ñåâé îùúðéí</title> <para> - Because PHP determines the types of variables and converts them - (generally) as needed, it is not always obvious what type a given - variable is at any one time. PHP includes several functions - which find out what type a variable is. They are + á- PHP àéï äôøãä áéï ñåâé îùúðéí åáãøê-ëìì äúáöòåú äîøåú + ìôé äöåøê åìëï ìà úîéã áøåø îäå ñåâ äîùúðä áëì æîï ðúåï. + á- PHP îñôø ôåð÷öéåú ìîöéàú ñåâ äîùúðä: <function>gettype</function>, <function>is_long</function>, <function>is_double</function>, <function>is_string</function>, - <function>is_array</function>, and + <function>is_array</function>, å- <function>is_object</function>. </para> </sect2>