cvs: phpdoc /nl/chapters install.xml intro.xml /nl/functions curl.xml image.xml ldap.xml mail.xml mhash.xml shmop.xml /nl/language
control-structures.xml

From: Date: Fri, 27 Oct 2000 17:27:55 +0000
Subject: cvs: phpdoc /nl/chapters install.xml intro.xml /nl/functions curl.xml image.xml ldap.xml mail.xml mhash.xml shmop.xml /nl/language
control-structures.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969332670@lists.php.net to get a copy of this message
derick Fri Oct 27 10:27:55 2000 EDT Modified files: /phpdoc/nl/chapters install.xml intro.xml /phpdoc/nl/functions curl.xml image.xml ldap.xml mail.xml mhash.xml shmop.xml /phpdoc/nl/language control-structures.xml Log: - Updated from Enlgish tree (plus some translation in language/control- structures.

Index: phpdoc/nl/chapters/install.xml diff -u phpdoc/nl/chapters/install.xml:1.3 phpdoc/nl/chapters/install.xml:1.4 --- phpdoc/nl/chapters/install.xml:1.3 Wed Oct 18 15:13:07 2000 +++ phpdoc/nl/chapters/install.xml Fri Oct 27 10:27:55 2000 @@ -618,7 +618,8 @@ <listitem> <para> PHP 3, PHP 4: Include InterBase support. DIR is the InterBase base - install directory, which defaults to <filename>/usr/interbase</filename>. + install directory, which defaults to + <filename>/usr/interbase</filename>. </para> <simpara> <link linkend="ref.ibase">Interbase functions</link> @@ -1667,8 +1668,8 @@ <filename>/usr/local/lib</filename> </para> <para> - PHP 4: Sets the path in which to look for php.ini. Defaults to - <filename>/usr/local/lib</filename> + PHP 4: Sets the path in which to look for <filename>php.ini</filename>. + Defaults to <filename>/usr/local/lib</filename> </para> </listitem> </varlistentry> @@ -3063,6 +3064,41 @@ PHP. </simpara> + </sect2> + + <sect2 id="install.windowsnt.installer"> + <title>Windows Installshield</title> + + <para> + The Windows PHP installer available from the downloads page at + <ulink url="&url.php;">&url.php;</ulink> installs the CGI version of + PHP and, for IIS, PWS, and Xitami, configures the web server as well. + </para> + + <simpara> + Install your choosen http server on your system and make sure it all works. + </simpara> + + <simpara> + Run the installer exe file and follow the instructions provided by the + installation wizard. Two types of installation are supported - standard, + which provides sensible defaults for all the settings it can, and + advanced, which asks questions as it goes along. + </simpara> + + <simpara> + The installation wizard gathers enough information to set up the + <filename>php.ini</filename> file and configure the web server to use PHP. + For IIS and also PWS on NT Workstation, a list of all the nodes on the server + with script map settings is displayed, and you can choose those nodes to which + you wish to add the PHP script mappings. + </simpara> + + <simpara> + Once the installation has completed the installer will inform you if you + need to restart your system, restart the server, or just start using PHP. + </simpara> + </sect2> <sect2 id="install.windows.modules"> Index: phpdoc/nl/chapters/intro.xml diff -u phpdoc/nl/chapters/intro.xml:1.4 phpdoc/nl/chapters/intro.xml:1.5 --- phpdoc/nl/chapters/intro.xml:1.4 Wed Oct 18 16:02:18 2000 +++ phpdoc/nl/chapters/intro.xml Fri Oct 27 10:27:55 2000 @@ -70,6 +70,7 @@ <member>dBase</member> <member>Empress</member> <member>FilePro (read-only)</member> + <member>Hyperwave</member> <member>IBM DB2</member> <member>Informix</member> <member>Ingres</member> @@ -80,6 +81,7 @@ <member>MySQL</member> <member>ODBC</member> <member>Oracle (OCI7 and OCI8)</member> + <member>Ovrimos</member> <member>PostgreSQL</member> <member>Solid</member> <member>Sybase</member> Index: phpdoc/nl/functions/curl.xml diff -u phpdoc/nl/functions/curl.xml:1.1 phpdoc/nl/functions/curl.xml:1.2 --- phpdoc/nl/functions/curl.xml:1.1 Tue Oct 10 15:07:53 2000 +++ phpdoc/nl/functions/curl.xml Fri Oct 27 10:27:55 2000 @@ -372,7 +372,7 @@ <simpara> <parameter>CURLOPT_FTPPORT</parameter>: Pass a string containing the which will be used to get the IP address to use - for the ftp "PORT" instruction. The POST instruction tells + for the ftp "POST" instruction. The POST instruction tells the remote server to connect to our specified IP address. The string may be a plain IP address, a hostname, a network interface name (under UNIX), or just a plain '-' to use the Index: phpdoc/nl/functions/image.xml diff -u phpdoc/nl/functions/image.xml:1.2 phpdoc/nl/functions/image.xml:1.3 --- phpdoc/nl/functions/image.xml:1.2 Thu Oct 19 15:01:23 2000 +++ phpdoc/nl/functions/image.xml Fri Oct 27 10:27:55 2000 @@ -1088,7 +1088,7 @@ </note> <note> <para> - In PHP4 as of version 4.0.2 you can use the function + As of version 3.0.18 and 4.0.2 you can use the function <function>imagetypes</function> in place of <function>function_exists</function> for checking the presence of the various supported image formats: Index: phpdoc/nl/functions/ldap.xml diff -u phpdoc/nl/functions/ldap.xml:1.2 phpdoc/nl/functions/ldap.xml:1.3 --- phpdoc/nl/functions/ldap.xml:1.2 Sat Oct 14 06:26:34 2000 +++ phpdoc/nl/functions/ldap.xml Fri Oct 27 10:27:55 2000 @@ -225,7 +225,7 @@ attributes. In case of multiple values for an attribute, they are indexed using integers starting with 0. </para> - <informalexample> + <informalexample> <literallayout> entry["attribute1"] = value entry["attribute2"][0] = value1 @@ -359,7 +359,7 @@ // prepare data $dn = "cn=Matti Meikku, ou=My Unit, o=My Company, c=FI"; $value = "secretpassword"; - $attr = "password"; + $attr = "password"; // compare value $r=ldap_compare($ds, $dn, $attr, $value); @@ -895,7 +895,7 @@ return_value[i]["attribute"][j] = jth value of attribute in ith entry </literallayout> </informalexample></para> - + <para> see also <function>ldap_first_entry</function> and <function>ldap_next_entry</function></para> @@ -903,6 +903,54 @@ </refentry> + <refentry id="function.ldap-get-option"> + <refnamediv> + <refname>ldap_get_option</refname> + <refpurpose>Get the current value for given option</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>boolean <function>ldap_get_option</function></funcdef> + <paramdef>int <parameter>link_identifier</parameter></paramdef> + <paramdef>int <parameter>option</parameter></paramdef> + <paramdef>mixed <parameter>retval</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + Sets <parameter>retval</parameter> to the value of the specified option, + and returns true on success and false on error.</para> + <para> + The parameter <parameter>option</parameter> can be one of: + LDAP_OPT_DEREF, LDAP_OPT_SIZELIMIT, LDAP_OPT_TIMELIMIT, + LDAP_OPT_PROTOCOL_VERSION, LDAP_OPT_ERROR_NUMBER, LDAP_OPT_REFERRALS, + LDAP_OPT_RESTART, LDAP_OPT_HOST_NAME, LDAP_OPT_ERROR_STRING, + LDAP_OPT_MATCHED_DN. These are described in + <ulink url="&url.ldap.openldap-c-api;">draft-ietf-ldapext-ldap-c-api-xx.txt</ulink> + </para> + <para>This function is only available when using OpenLDAP 2.x.x, and was + added in PHP 4.0.4</para> + + <para> + <example> + <title>Check protocol version</title> +<programlisting role="php"> +// $ds is a valid link identifier for a directory server +if (ldap_get_option($ds, LDAP_OPT_PROTOCOL_VERSION, $version)) + echo "Using protocol version $version"; +else + echo "Unable to determine protocol version"; +</programlisting> + </example> + </para> + + <para> + See also <function>ldap_set_option</function>.</para> + </refsect1> + </refentry> + + <refentry id="function.ldap-get-values"> <refnamediv> <refname>ldap_get_values</refname> @@ -1130,11 +1178,11 @@ </funcsynopsis> <para> returns true on success and false on error.</para> - <para> - This function adds attribute(s) to the specified dn. It - performs the modification at the attribute level as opposed to the - object level. Object-level additions are done by the - <function>ldap_add</function> function.</para> + <para> + This function adds attribute(s) to the specified dn. It + performs the modification at the attribute level as opposed to the + object level. Object-level additions are done by the + <function>ldap_add</function> function.</para> </refsect1> </refentry> @@ -1155,11 +1203,11 @@ </funcsynopsis> <para> returns true on success and false on error.</para> - <para> - This function removes attribute(s) from the specified dn. It - performs the modification at the attribute level as opposed to the - object level. Object-level deletions are done by the - <function>ldap_del</function> function.</para> + <para> + This function removes attribute(s) from the specified dn. It + performs the modification at the attribute level as opposed to the + object level. Object-level deletions are done by the + <function>ldap_del</function> function.</para> </refsect1> </refentry> @@ -1180,11 +1228,11 @@ </funcsynopsis> <para> returns true on success and false on error.</para> - <para> - This function replaces attribute(s) from the specified dn. It - performs the modification at the attribute level as opposed to the - object level. Object-level modifications are done by the - <function>ldap_modify</function> function.</para> + <para> + This function replaces attribute(s) from the specified dn. It + performs the modification at the attribute level as opposed to the + object level. Object-level modifications are done by the + <function>ldap_modify</function> function.</para> </refsect1> </refentry> @@ -1301,7 +1349,7 @@ </para> <note> <para> - These optional parameters were added in 4.0.2: + These optional parameters were added in 4.0.2: <parameter>attrsonly</parameter>, <parameter>sizelimit</parameter>, <parameter>timelimit</parameter>, @@ -1419,7 +1467,7 @@ </itemizedlist> </para> <para> - These optional parameters were added in 4.0.2: + These optional parameters were added in 4.0.2: <parameter>attrsonly</parameter>, <parameter>sizelimit</parameter>, <parameter>timelimit</parameter>, @@ -1456,6 +1504,54 @@ </programlisting> </example></para> + </refsect1> + </refentry> + + + <refentry id="function.ldap-set-option"> + <refnamediv> + <refname>ldap_set_option</refname> + <refpurpose>Set the value of the given option</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>boolean <function>ldap_set_option</function></funcdef> + <paramdef>int <parameter>link_identifier</parameter></paramdef> + <paramdef>int <parameter>option</parameter></paramdef> + <paramdef>mixed <parameter>newval</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + Sets the value of the specified option to be + <parameter>newval</parameter>, and returns true on success and false + on error.</para> + <para> + The parameter <parameter>option</parameter> can be one of: + LDAP_OPT_DEREF, LDAP_OPT_SIZELIMIT, LDAP_OPT_TIMELIMIT, + LDAP_OPT_PROTOCOL_VERSION, LDAP_OPT_ERROR_NUMBER, LDAP_OPT_REFERRALS, + LDAP_OPT_RESTART, LDAP_OPT_HOST_NAME, LDAP_OPT_ERROR_STRING, + LDAP_OPT_MATCHED_DN. These are described in + <ulink url="&url.ldap.openldap-c-api;">draft-ietf-ldapext-ldap-c-api-xx.txt</ulink></para> + <para>This function is only available when using OpenLDAP 2.x.x, and was + added in PHP 4.0.4</para> + + <para> + <example> + <title>Set protocol version</title> +<programlisting role="php"> +// $ds is a valid link identifier for a directory server +if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) + echo "Using LDAPv3"; +else + echo "Failed to set protocol version to 3"; +</programlisting> + </example> + </para> + + <para> + See also <function>ldap_get_option</function>.</para> </refsect1> </refentry> Index: phpdoc/nl/functions/mail.xml diff -u phpdoc/nl/functions/mail.xml:1.2 phpdoc/nl/functions/mail.xml:1.3 --- phpdoc/nl/functions/mail.xml:1.2 Wed Oct 11 09:52:06 2000 +++ phpdoc/nl/functions/mail.xml Fri Oct 27 10:27:55 2000 @@ -82,13 +82,14 @@ $headers .= "X-Priority: 1\n"; // Urgent message! $headers .= "Return-Path: &lt;birthday@php.net>\n"; // Return path for errors -$headers .= "Content-Type: text/html; charset=iso-8859-1\n" // Mime type +/* If you want to send html mail, uncomment the following line */ +// $headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type $headers .= "cc:birthdayarchive@php.net\n"; // CC to $headers .= "bcc:birthdaycheck@php.net, birthdaygifts@php.net\n"; // BCCs to /* and now mail it */ -mail($recipent, $subject, $message, $headers); +mail($recipient, $subject, $message, $headers); </programlisting> </example> </para> Index: phpdoc/nl/functions/mhash.xml diff -u phpdoc/nl/functions/mhash.xml:1.2 phpdoc/nl/functions/mhash.xml:1.3 --- phpdoc/nl/functions/mhash.xml:1.2 Wed Oct 18 15:13:08 2000 +++ phpdoc/nl/functions/mhash.xml Fri Oct 27 10:27:55 2000 @@ -239,6 +239,43 @@ </refsect1> </refentry> + <refentry id="function.mhash-keygen-s2k"> + <refnamediv> + <refname>mhash_keygen_s2k</refname> + <refpurpose>Generates a key</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>mhash_keygen_s2k</function></funcdef> + <paramdef>int <parameter>hash</parameter></paramdef> + <paramdef>string <parameter>password</parameter></paramdef> + <paramdef>string <parameter>salt</parameter></paramdef> + <paramdef>int <parameter>bytes</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>Mhash_keygen_s2k</function> generates a key that is + <parameter>bytes</parameter> long, from a user given password. + This is the Salted S2K algorithm as specified in the OpenPGP + document (RFC 2440). That algorithm will use the specified + <parameter>hash</parameter> algorithm to create the key. + The <parameter>salt</parameter> must be different and random + enough for every key you generate in order to create different keys. + That salt must be known when you check the keys, thus it is + a good idea to append the key to it. Salt has a fixed length + of 8 bytes and will be padded with zeros if you supply less bytes. + Keep in mind that user supplied passwords are not really suitable + to be used as keys in cryptographic algorithms, since users normally + choose keys they can write on keyboard. These passwords use + only 6 to 7 bits per character (or less). It is highly recommended + to use some kind of tranformation (like this function) to the user + supplied key. + </para> + </refsect1> + </refentry> + </reference> <!-- Keep this comment at the end of the file Index: phpdoc/nl/functions/shmop.xml diff -u phpdoc/nl/functions/shmop.xml:1.3 phpdoc/nl/functions/shmop.xml:1.4 --- phpdoc/nl/functions/shmop.xml:1.3 Fri Oct 20 15:44:17 2000 +++ phpdoc/nl/functions/shmop.xml Fri Oct 27 10:27:55 2000 @@ -49,7 +49,7 @@ //Now lets delete the block and close the shared memory segment if(!shmop_delete($shm_id)) { - echo "Couldn't mark shared memory block for deletion. + echo "Couldn't mark shared memory block for deletion."; } shmop_close($shm_id); Index: phpdoc/nl/language/control-structures.xml diff -u phpdoc/nl/language/control-structures.xml:1.2 phpdoc/nl/language/control-structures.xml:1.3 --- phpdoc/nl/language/control-structures.xml:1.2 Wed Oct 11 09:56:54 2000 +++ phpdoc/nl/language/control-structures.xml Fri Oct 27 10:27:55 2000 @@ -2,101 +2,104 @@ <title>Control Structures</title> <simpara> - Any PHP script is built out of a series of statements. A statement - can be an assignment, a function call, a loop, a conditional - statement of even a statement that does nothing (an empty - statement). Statements usually end with a semicolon. In addition, - statements can be grouped into a statement-group by encapsulating a - group of statements with curly braces. A statement-group is a - statement by itself as well. The various statement types are - described in this chapter. + Elk PHP script bestaat uit reeksen van statements. Een statement + kan een assignment, een functie aanroep, een loop, een conditional + statement of zelfs een statement dat niets doet (een empty + statement) zijn. Statements eindigen gewoonlijk met een puntkomma. + Als toevoeging hierop kunnen statements gegroepeerd worden tot een + statement-groep door deze te omvatten met accolades. Een statement-groep + is een stament bij zichzelf. De overige statements zijn beschreven in + dit hoofdstuk. </simpara> <sect1 id="control-structures.if"> <title><literal>if</literal></title> <para> - The <literal>if</literal> construct is one of the most important - features of many languages, PHP included. It allows for - conditional execution of code fragments. PHP features an - <literal>if</literal> structure that is similar to that of C: + De <literal>if</literal> constructie is een van de meeste belangrijke + in veel talen, zoals ook in PHP. It maakt het mogelijk om conditionele + stukken code uit te voeren. PHP heeft een <literal>if</literal> + structuur die gelijk is als die van de taal C. <informalexample> <programlisting> -if (expr) +if (expressie) statement </programlisting> </informalexample> </para> <simpara> - As described in the section about expressions, expr is evaluated - to its truth value. If <replaceable>expr</replaceable> evaluates - to <literal>TRUE</literal>, PHP will execute statement, and if it - evaluates to <literal>FALSE</literal> - it'll ignore it. + Zoals is beschreven in de sectie over expressies, wordt + &quot;expressie&quot; geevalueerd naar zijn &quot;truth&quot; waarde. + to its truth value. Als de <replaceable>expressie</replaceable> + evalueerd tot <literal>TRUE</literal>, dan zal PHP the statement uitvoeren, + en als de expressie evalueerd naar <literal>FALSE</literal>, dan zal het + statement worden overgeslagen. </simpara> <para> - The following example would display <computeroutput>a is bigger - than b</computeroutput> if <replaceable>$a</replaceable> is bigger - than <replaceable>$b</replaceable>: + De volgende voorbeeld zal bijvoorbeeld tonen <computeroutput>a is groter + dan b</computeroutput> indien <replaceable>$a</replaceable> is groter + dan <replaceable>$b</replaceable>: <informalexample> <programlisting role="php"> -if ($a > $b) - print "a is bigger than b"; +if ($a &gt; $b) + print "a is groter dan b"; </programlisting> </informalexample> </para> <para> - Often you'd want to have more than one statement to be executed - conditionally. Of course, there's no need to wrap each statement - with an <literal>if</literal> clause. Instead, you can group - several statements into a statement group. For example, this code - would display <computeroutput>a is bigger than b</computeroutput> - if <replaceable>$a</replaceable> is bigger than - <replaceable>$b</replaceable>, and would then assign the value of - <replaceable>$a</replaceable> into <replaceable>$b</replaceable>: + Vaak zul je willen dat er meer dan &eacute;&eacute;n statement conditioneel + wordt uitgevoerd. Natuurlijk hoef je niet elk statement met een + <literal>if</literal> clause te omvatten. In plaats daarvan kun je een + meerdere statements tot een statement groep maken. De code in het volgende + voorbeeld zal tonen <computeroutput>a is groter dan b</computeroutput> + als <replaceable>$a</replaceable> groter is dan + <replaceable>$b</replaceable>, en het zal de waarde van de variabele + <replaceable>$a</replaceable> naar <replaceable>$b</replaceable> + kopie&euml;ren: <informalexample> <programlisting role="php"> -if ($a > $b) { - print "a is bigger than b"; +if ($a &gt; $b) { + print "a is groter dan b"; $b = $a; } </programlisting> </informalexample> </para> <simpara> - If statements can be nested indefinitely within other - <literal>if</literal> statements, which provides you with complete - flexibility for conditional execution of the various parts of your - program. + If statements kunnen oneindig worden genest binnen andere + <literal>if</literal> statements. Dit geeft je de complete flexibiliteit + voor conditionele uitvoering van verschillende dele van je programma. </simpara> </sect1> <sect1 id="control-structures.else"> <title><literal>else</literal></title> <para> - Often you'd want to execute a statement if a certain condition is - met, and a different statement if the condition is not met. This - is what <literal>else</literal> is for. <literal>else</literal> - extends an <literal>if</literal> statement to execute a statement - in case the expression in the <literal>if</literal> statement - evaluates to <literal>FALSE</literal>. For example, the following - code would display <computeroutput>a is bigger than - b</computeroutput> if <replaceable>$a</replaceable> is bigger than - <replaceable>$b</replaceable>, and <computeroutput>a is NOT bigger - than b</computeroutput> otherwise: + Vaak zul je &eacute;&eacute; statement willen uitvoeren als er aan een + bepaalde voorwaarde is voldaan, en een ander statement als er niet + aan de voorwaarde is voldaan. Hierom bestaat<literal>else</literal>. + <literal>else</literal> breidt een if statement uit met de mogelijkheid + om een statement uit te voeren als de expressie in het + <literal>if</literal> evalueerd tot <literal>FALSE</literal>. Het + onderstaande voorbeeld zal tonen <computeroutput>a is groter dan + b</computeroutput> als <replaceable>$a</replaceable> groter is dan + <replaceable>$b</replaceable>, en <computeroutput>a is NIET groter + dan b</computeroutput> indien <replaceable>$a</replaceable> niet groter + is dan <replaceable>$b</replaceable>. <informalexample> <programlisting role="php"> -if ($a > $b) { - print "a is bigger than b"; +if ($a &gt; $b) { + print "a is groter dan b"; } else { - print "a is NOT bigger than b"; + print "a is NIET groter dan b"; } </programlisting> </informalexample> - The <literal>else</literal> statement is only executed if the - <literal>if</literal> expression evaluated to - <literal>FALSE</literal>, and if there were any - <literal>elseif</literal> expressions - only if they evaluated to - <literal>FALSE</literal> as well (see <link + Het <literal>else</literal> statement wordt alleen maar uitgevoerd als + de <literal>if</literal> expressie evalueerd tot + <literal>FALSE</literal>, en als alle mogelijke + <literal>elseif</literal> expressies ook tot + <literal>FALSE</literal> evalueren (zie <link linkend="control-structures.elseif">elseif</link>). </para> @@ -105,11 +108,11 @@ <sect1 id="control-structures.elseif"> <title><literal>elseif</literal></title> <para> - <literal>elseif</literal>, as its name suggests, is a combination - of <literal>if</literal> and <literal>else</literal>. Like - <literal>else</literal>, it extends an <literal>if</literal> - statement to execute a different statement in case the original - <literal>if</literal> expression evaluates to + <literal>elseif</literal>, zoals de naam al suggereerd is een combinatie + van de <literal>if</literal> en de <literal>else</literal>. Net zoals + de <literal>else</literal>, breidt het de <literal>if</literal> + uit met de mogelijkheid om een ander statement uit te voeren als de + <literal>if</literal> expressie evalueerd naar <literal>FALSE</literal>. However, unlike <literal>else</literal>, it will execute that alternative expression only if the <literal>elseif</literal> conditional @@ -119,7 +122,7 @@ or <computeroutput>a is smaller than b</computeroutput>: <informalexample> <programlisting role="php"> -if ($a > $b) { +if ($a &gt; $b) { print "a is bigger than b"; } elseif ($a == $b) { print "a is equal to b"; @@ -286,7 +289,7 @@ $i = 0; do { print $i; -} while ($i>0); +} while ($i &gt; 0); </programlisting> </informalexample> </para> @@ -442,7 +445,7 @@ <informalexample> <programlisting> foreach(array_expression as $value) statement -foreach(array_expression as $key => $value) statement +foreach(array_expression as $key =&gt; $value) statement </programlisting> </informalexample> </para> @@ -501,7 +504,7 @@ echo "Key: $key; Value: $value&lt;br&gt;\n"; } -foreach ($arr as $key => $value) { +foreach ($arr as $key =&gt; $value) { echo "Key: $key; Value: $value&lt;br&gt;\n"; } </programlisting> @@ -526,20 +529,20 @@ $i = 0; /* for illustrative purposes only */ foreach($a as $v) { - print "\$a[$i] => $k.\n"; + print "\$a[$i] =&gt; $k.\n"; } /* foreach example 3: key and value */ $a = array ( - "one" => 1, - "two" => 2, - "three" => 3, - "seventeen" => 17 + "one" =&gt; 1, + "two" =&gt; 2, + "three" =&gt; 3, + "seventeen" =&gt; 17 ); -foreach($a as $k => $v) { - print "\$a[$k] => $v.\n"; +foreach($a as $k =&gt; $v) { + print "\$a[$k] =&gt; $v.\n"; } </programlisting> </informalexample>
« previous php.doc (#969332670) next »