cvs: phpdoc-de /reference/array/functions array-reverse.xml array-shift.xml array-slice.xml array-splice.xml array-sum.xml array-unique.xml
array-unshift.xml array-values.xml array-walk.xml array.xml arsort.xml asort.xml compact.xml count.xml current.xml each.xml extract.xml in-array.xml
krsort.xml ksort.xml list.xml natsort.xml range.xml reset.xml rsort.xml shuffle.xml sizeof.xml sort.xml uksort.xml usort.xml

From: Date: Sun, 29 Jun 2003 07:44:02 +0000
Subject: cvs: phpdoc-de /reference/array/functions array-reverse.xml array-shift.xml array-slice.xml array-splice.xml array-sum.xml array-unique.xml
array-unshift.xml array-values.xml array-walk.xml array.xml arsort.xml asort.xml compact.xml count.xml current.xml each.xml extract.xml in-array.xml
krsort.xml ksort.xml list.xml natsort.xml range.xml reset.xml rsort.xml shuffle.xml sizeof.xml sort.xml uksort.xml usort.xml
Groups: php.doc.de 
Request: Send a blank email to doc-de+get-818@lists.php.net to get a copy of this message
tom Sun Jun 29 03:44:02 2003 EDT Modified files: /phpdoc-de/reference/array/functions array-reverse.xml array-shift.xml array-slice.xml array-splice.xml array-sum.xml array-unique.xml array-unshift.xml array-values.xml array-walk.xml array.xml arsort.xml asort.xml compact.xml count.xml current.xml each.xml extract.xml in-array.xml krsort.xml ksort.xml list.xml natsort.xml range.xml reset.xml rsort.xml shuffle.xml sizeof.xml sort.xml uksort.xml usort.xml Log: sync to en

Index: phpdoc-de/reference/array/functions/array-reverse.xml diff -u phpdoc-de/reference/array/functions/array-reverse.xml:1.4 phpdoc-de/reference/array/functions/array-reverse.xml:1.5 --- phpdoc-de/reference/array/functions/array-reverse.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/array-reverse.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: tom Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.6 Maintainer: tom Status: ready --> <refentry id="function.array-reverse"> <refnamediv> <refname>array_reverse</refname> @@ -27,9 +27,11 @@ <title><function>array_reverse</function></title> <programlisting role="php"> <![CDATA[ +<?php $input = array ("php", 4.0, array ("grün", "rot")); $result = array_reverse ($input); $result_keyed = array_reverse ($input, TRUE); +?> ]]> </programlisting> <para> @@ -38,7 +40,8 @@ Beachten Sie den Unterschied zwischen den Schlüsseln. Die Ausgabe von <varname>$result</varname> und <varname>$result_keyed</varname> wird wie folgt aussehen: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Array ( @@ -63,9 +66,7 @@ [0] => php ) ]]> - </screen> - </para> - + </screen> </example> </para> <note> Index: phpdoc-de/reference/array/functions/array-shift.xml diff -u phpdoc-de/reference/array/functions/array-shift.xml:1.6 phpdoc-de/reference/array/functions/array-shift.xml:1.7 --- phpdoc-de/reference/array/functions/array-shift.xml:1.6 Fri Feb 7 17:58:46 2003 +++ phpdoc-de/reference/array/functions/array-shift.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.7 Maintainer: tom Status: ready --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.8 Maintainer: tom Status: ready --> <refentry id="function.array-shift"> <refnamediv> <refname>array_shift</refname> @@ -26,10 +26,9 @@ &array.resetspointer; - <para> - <example> - <title><function>array_shift</function></title> - <programlisting role="php"> + <example> + <title><function>array_shift</function></title> + <programlisting role="php"> <![CDATA[ <?php $stack = array ("Orange", "Banane", "Apfel", "Himbeere"); @@ -37,10 +36,11 @@ print_r($stack); ?> ]]> - </programlisting> - <para> - Danach blieben in <varname>$stack</varname> 3 Elemente übrig: - <screen role="php"> + </programlisting> + <para> + Danach blieben in <varname>$stack</varname> 3 Elemente übrig: + </para> + <screen role="php"> <![CDATA[ Array ( @@ -49,12 +49,12 @@ [2] => Himbeere ) ]]> - </screen> - und <literal>orange</literal> wird - <varname>$fruit</varname> zugeordnet. - </para> - </example> - </para> + </screen> + <para> + und <literal>orange</literal> wird + <varname>$fruit</varname> zugeordnet. + </para> + </example> <para> Siehe auch <function>array_unshift</function>, <function>array_push</function> und Index: phpdoc-de/reference/array/functions/array-slice.xml diff -u phpdoc-de/reference/array/functions/array-slice.xml:1.4 phpdoc-de/reference/array/functions/array-slice.xml:1.5 --- phpdoc-de/reference/array/functions/array-slice.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/array-slice.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: tom Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.5 Maintainer: tom Status: ready --> <refentry id="function.array-slice"> <refnamediv> <refname>array_slice</refname> @@ -49,12 +49,14 @@ <title><function>array_slice</function></title> <programlisting role="php"> <![CDATA[ +<?php $input = array ("a", "b", "c", "d", "e"); $output = array_slice ($input, 2); // liefert "c", "d", und "e" $output = array_slice ($input, 2, -1); // liefert "c", "d" $output = array_slice ($input, -2, 1); // liefert "d" $output = array_slice ($input, 0, 3); // liefert "a", "b", und "c" +?> ]]> </programlisting> </example> Index: phpdoc-de/reference/array/functions/array-splice.xml diff -u phpdoc-de/reference/array/functions/array-splice.xml:1.6 phpdoc-de/reference/array/functions/array-splice.xml:1.7 --- phpdoc-de/reference/array/functions/array-splice.xml:1.6 Fri Feb 7 17:58:46 2003 +++ phpdoc-de/reference/array/functions/array-splice.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.6 Maintainer: tom Status: ready --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.7 Maintainer: tom Status: ready --> <refentry id="function.array-splice"> <refnamediv> <refname>array_splice</refname> @@ -118,6 +118,7 @@ <title><function>array_splice</function></title> <programlisting role="php"> <![CDATA[ +<?php $input = array ("rot", "grün", "blau", "gelb"); array_splice ($input, 2); // $input ist nun array ("rot", "grün") @@ -133,6 +134,7 @@ $input = array ("rot", "grün", "blau", "gelb"); array_splice ($input, -1, 1, array("schwarz", "braun")); // $input ist nun array ("rot", "grün", "blau", "schwarz", "braun") +?> ]]> </programlisting> </example> Index: phpdoc-de/reference/array/functions/array-sum.xml diff -u phpdoc-de/reference/array/functions/array-sum.xml:1.4 phpdoc-de/reference/array/functions/array-sum.xml:1.5 --- phpdoc-de/reference/array/functions/array-sum.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/array-sum.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: tom Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.7 Maintainer: tom Status: ready --> <refentry id="function.array-sum"> <refnamediv> <refname>array_sum</refname> @@ -23,27 +23,29 @@ <title><function>array_sum</function></title> <programlisting role="php"> <![CDATA[ +<?php $a = array(2, 4, 6, 8); echo "sum(a) = ".array_sum($a)."\n"; $b = array("a"=>1.2,"b"=>2.3,"c"=>3.4); echo "sum(b) = ".array_sum($b)."\n"; +?> ]]> </programlisting> <para> Obiges Programm wird folgendes ausgeben: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ sum(a) = 20 sum(b) = 6.9 ]]> - </screen> - </para> + </screen> </example> </para> <note> <para> - PHP Versionen vor 4.0.6 haben das übergebene Array selbst + PHP Versionen vor 4.2.1 haben das übergebene Array selbst modifiziert, und Strings in Zahlen konvertiert (welche abhängig von deren Wert meist zu null konvertiert wurden). </para> Index: phpdoc-de/reference/array/functions/array-unique.xml diff -u phpdoc-de/reference/array/functions/array-unique.xml:1.5 phpdoc-de/reference/array/functions/array-unique.xml:1.6 --- phpdoc-de/reference/array/functions/array-unique.xml:1.5 Fri Feb 7 17:58:46 2003 +++ phpdoc-de/reference/array/functions/array-unique.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.10 Maintainer: tom Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.11 Maintainer: tom Status: ready --> <refentry id="function.array-unique"> <refnamediv> <refname>array_unique</refname> @@ -49,7 +49,8 @@ </programlisting> <para> Dies wird folgendes ausgeben: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Array ( @@ -58,8 +59,7 @@ [1] => blau ) ]]> - </screen> - </para> + </screen> </example> </para> <para> @@ -76,15 +76,15 @@ </programlisting> <para> Dies wird folgendes ausgeben: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ array(2) { [0] => int(4) [2] => string(1) "3" } ]]> - </screen> - </para> + </screen> </example> </para> </refsect1> Index: phpdoc-de/reference/array/functions/array-unshift.xml diff -u phpdoc-de/reference/array/functions/array-unshift.xml:1.5 phpdoc-de/reference/array/functions/array-unshift.xml:1.6 --- phpdoc-de/reference/array/functions/array-unshift.xml:1.5 Sun Oct 6 16:40:51 2002 +++ phpdoc-de/reference/array/functions/array-unshift.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.5 Maintainer: tom Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.7 Maintainer: tom Status: ready --> <refentry id="function.array-unshift"> <refnamediv> <refname>array_unshift</refname> @@ -35,14 +35,17 @@ <title><function>array_unshift</function></title> <programlisting role="php"> <![CDATA[ +<?php $queue = array ("Orange", "Banane"); array_unshift ($queue, "Apfel", "Himbeere"); +?> ]]> </programlisting> <para> Als Ergebnis enthält <varname>$queue</varname> die folgenden Elemente: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Array ( @@ -52,8 +55,7 @@ [3] => Banane ) ]]> - </screen> - </para> + </screen> </example> </para> <para> Index: phpdoc-de/reference/array/functions/array-values.xml diff -u phpdoc-de/reference/array/functions/array-values.xml:1.5 phpdoc-de/reference/array/functions/array-values.xml:1.6 --- phpdoc-de/reference/array/functions/array-values.xml:1.5 Fri Feb 7 17:58:46 2003 +++ phpdoc-de/reference/array/functions/array-values.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.5 Maintainer: tom Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.7 Maintainer: tom Status: ready --> <refentry id="function.array-values"> <refnamediv> <refname>array_values</refname> @@ -21,13 +21,16 @@ <title><function>array_values</function></title> <programlisting role="php"> <![CDATA[ +<?php $array = array ("größe" => "XL", "farbe" => "gold"); print_r(array_values ($array)); +?> ]]> </programlisting> <para> Dies wird folgendes ausgeben: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Array ( @@ -35,33 +38,9 @@ [1] => gold ) ]]> - </screen> - </para> + </screen> </example> </para> - <note> - <para> - Diese Funktion wurde in PHP 4 hinzugefügt, nachstehend findet - sich eine Implementation für Benutzer von PHP 3. - <example> - <title> - Implementation von <function>array_values</function> für PHP 3 - Benutzer - </title> - <programlisting role="php"> -<![CDATA[ -function array_values ($arr) { - $t = array(); - while (list($k, $v) = each ($arr)) { - $t[] = $v; - } - return $t; -} -]]> - </programlisting> - </example> - </para> - </note> <para> Siehe auch <function>array_keys</function>. </para> Index: phpdoc-de/reference/array/functions/array-walk.xml diff -u phpdoc-de/reference/array/functions/array-walk.xml:1.7 phpdoc-de/reference/array/functions/array-walk.xml:1.8 --- phpdoc-de/reference/array/functions/array-walk.xml:1.7 Wed Jan 15 15:23:11 2003 +++ phpdoc-de/reference/array/functions/array-walk.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- EN-Revision: 1.8 Maintainer: tom Status: ready --> +<!-- $Revision: 1.8 $ --> +<!-- EN-Revision: 1.11 Maintainer: tom Status: ready --> <refentry id="function.array-walk"> <refnamediv> <refname>array_walk</refname> @@ -10,12 +10,15 @@ </refnamediv> <refsect1> <title>Beschreibung</title> - <methodsynopsis> - <type>int</type><methodname>array_walk</methodname> - <methodparam><type>array</type><parameter>array</parameter></methodparam> - <methodparam><type>callback</type><parameter>function</parameter></methodparam> - <methodparam choice="opt"><type>mixed</type><parameter>userdata</parameter></methodparam> - </methodsynopsis> + <methodsynopsis> + <type>int</type><methodname>array_walk</methodname> + <methodparam><type>array</type><parameter>array</parameter></methodparam> + <methodparam><type>callback</type><parameter>function</parameter></methodparam> + <methodparam choice="opt"><type>mixed</type><parameter>userdata</parameter></methodparam> + </methodsynopsis> + <simpara> + &return.success; + </simpara> <simpara> Wendet die mittels <parameter>function</parameter> angegebene Benutzerfunktion für jedes Element von <parameter>array</parameter> @@ -99,7 +102,8 @@ </programlisting> <para> Das obige Programm wird folgendes ausgeben: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Vorher ...: d. Zitrone @@ -112,8 +116,7 @@ b. Frucht: Banane c. Frucht: Apfel ]]> - </screen> - </para> + </screen> </example> </para> <simpara> Index: phpdoc-de/reference/array/functions/array.xml diff -u phpdoc-de/reference/array/functions/array.xml:1.5 phpdoc-de/reference/array/functions/array.xml:1.6 --- phpdoc-de/reference/array/functions/array.xml:1.5 Fri Feb 7 17:58:46 2003 +++ phpdoc-de/reference/array/functions/array.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.6 Maintainer: tom Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.10 Maintainer: tom Status: ready --> <refentry id="function.array"> <refnamediv> <refname>array</refname> @@ -10,13 +10,15 @@ </refnamediv> <refsect1> <title>Beschreibung</title> - <methodsynopsis> - <type>array</type><methodname>array</methodname> - <methodparam choice="opt"><type>mixed</type><parameter>...</parameter></methodparam> - </methodsynopsis> + <methodsynopsis> + <type>array</type><methodname>array</methodname> + <methodparam choice="opt"><type>mixed</type><parameter>...</parameter></methodparam> + </methodsynopsis> <para> Gibt ein den Parametern entsprechendes Array zurück. Mit dem <literal>=&gt;</literal> Operator können die Parameter indiziert werden. + Weitere Informationen zu Arrays finden Sie im Abschnitt + <link linkend="language.types.array">array type</link>. </para> <para> <note> @@ -44,11 +46,13 @@ <title><function>array</function></title> <programlisting role="php"> <![CDATA[ +<?php $fruits = array ( "Früchte" => array ("a"=>"Orange", "b"=>"Banane", "c"=>"Apfel"), "Zahlen" => array (1, 2, 3, 4, 5, 6), "Löcher" => array ("erstes", 5 => "zweites", "drittes") ); +?> ]]> </programlisting> </example> @@ -58,13 +62,16 @@ <title>Automatischer Index mit <function>array</function></title> <programlisting role="php"> <![CDATA[ +<?php $array = array( 1, 1, 1, 1, 1, 8=>1, 4=>1, 19, 3=>13); print_r($array); +?> ]]> </programlisting> <para> wird folgendes anzeigen: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Array ( @@ -77,9 +84,10 @@ [9] => 19 ) ]]> - </screen> - </para> + </screen> </example> + </para> + <para> Beachten Sie, dass Index '3' doppelt definiert ist, und den letzten definierten Wert 13 behält. Index 4 wurde nach dem Index 8 definiert, und der nächste generierte Index (Wert 19) ist 9, da der größte Index @@ -91,13 +99,16 @@ <title>1-basierter Index mit <function>array</function></title> <programlisting role="php"> <![CDATA[ +<?php $erstesquartal = array(1 => 'Januar', 'Februar', 'März'); print_r($erstesquartal); +?> ]]> </programlisting> <para> wird folgendes ausgeben: - <screen> + </para> + <screen> <![CDATA[ Array ( @@ -106,13 +117,14 @@ [3] => März ) ]]> - </screen> - </para> + </screen> </example> </para> <para> Siehe auch <function>array_pad</function>, - <function>list</function> und <function>range</function>. + <function>list</function>, + <link linkend="control-structures.foreach">foreach</link> und + <function>range</function>. </para> </refsect1> </refentry> Index: phpdoc-de/reference/array/functions/arsort.xml diff -u phpdoc-de/reference/array/functions/arsort.xml:1.4 phpdoc-de/reference/array/functions/arsort.xml:1.5 --- phpdoc-de/reference/array/functions/arsort.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/arsort.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: tom Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.6 Maintainer: tom Status: ready --> <refentry id="function.arsort"> <refnamediv> <refname>arsort</refname> @@ -26,25 +26,27 @@ <title><function>arsort</function></title> <programlisting role="php"> <![CDATA[ +<?php $fruits = array ("d"=>"Zitrone", "a"=>"Orange", "b"=>"Banane", "c"=>"Apfel"); arsort ($fruits); reset ($fruits); while (list ($key, $val) = each ($fruits)) { echo "$key = $val\n"; } +?> ]]> </programlisting> <para> Dieses Beispiel würde folgendes ausgeben: - <screen> + </para> + <screen> <![CDATA[ d = Zitrone a = Orange b = Banane c = Apfel ]]> - </screen> - </para> + </screen> </example> <para> Die Früchte wurden in umgekehrter alphabetischer Reihenfolge Index: phpdoc-de/reference/array/functions/asort.xml diff -u phpdoc-de/reference/array/functions/asort.xml:1.4 phpdoc-de/reference/array/functions/asort.xml:1.5 --- phpdoc-de/reference/array/functions/asort.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/asort.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: tom Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.6 Maintainer: tom Status: ready --> <refentry id="function.asort"> <refnamediv> <refname>asort</refname> @@ -26,25 +26,27 @@ <title><function>asort</function></title> <programlisting role="php"> <![CDATA[ +<?php $fruits = array ("d"=>"Zitrone", "a"=>"Orange", "b"=>"Banane", "c"=>"Apfel"); asort ($fruits); reset ($fruits); while (list ($key, $val) = each ($fruits)) { echo "$key = $val\n"; } +?> ]]> </programlisting> <para> Dieses Beispiel würde folgendes ausgeben: - <screen> + </para> + <screen> <![CDATA[ c = Apfel b = Banane a = Orange d = Zitrone ]]> - </screen> - </para> + </screen> </example> <para> Die Früchte wurden alphabetisch sortiert, und die Zuordnung Index: phpdoc-de/reference/array/functions/compact.xml diff -u phpdoc-de/reference/array/functions/compact.xml:1.4 phpdoc-de/reference/array/functions/compact.xml:1.5 --- phpdoc-de/reference/array/functions/compact.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/compact.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: tom Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.6 Maintainer: tom Status: ready --> <refentry id="function.compact"> <refnamediv> <refname>compact</refname> @@ -39,6 +39,7 @@ <title><function>compact</function></title> <programlisting role="php"> <![CDATA[ +<?php $city = "San Francisco"; $state = "CA"; $event = "SIGGRAPH"; @@ -46,11 +47,13 @@ $location_vars = array ("city", "state"); $result = compact ("event", "nothing_here", $location_vars); +?> ]]> </programlisting> <para> Danach wird <varname>$result</varname>: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Array ( @@ -59,8 +62,7 @@ [state] => CA ) ]]> - </screen> - </para> + </screen> </example> </para> <para> Index: phpdoc-de/reference/array/functions/count.xml diff -u phpdoc-de/reference/array/functions/count.xml:1.4 phpdoc-de/reference/array/functions/count.xml:1.5 --- phpdoc-de/reference/array/functions/count.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/count.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: tom Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.5 Maintainer: tom Status: ready --> <refentry id="function.count"> <refnamediv> <refname>count</refname> @@ -41,6 +41,7 @@ <title><function>count</function></title> <programlisting role="php"> <![CDATA[ +<?php $a[0] = 1; $a[1] = 3; $a[2] = 5; @@ -52,6 +53,7 @@ $b[10] = 11; $result = count ($b); // $result == 3; +?> ]]> </programlisting> </example> Index: phpdoc-de/reference/array/functions/current.xml diff -u phpdoc-de/reference/array/functions/current.xml:1.4 phpdoc-de/reference/array/functions/current.xml:1.5 --- phpdoc-de/reference/array/functions/current.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/current.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: tom Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.6 Maintainer: tom Status: ready --> <refentry id="function.current"> <refnamediv> <refname>current</refname> @@ -36,8 +36,9 @@ </warning> </para> <para> - Siehe auch <function>end</function>, <function>next</function>, - <function>prev</function> und <function>reset</function>. + Siehe auch <function>end</function>, <function>key</function>, + <function>next</function>, <function>prev</function> und + <function>reset</function>. </para> </refsect1> </refentry> Index: phpdoc-de/reference/array/functions/each.xml diff -u phpdoc-de/reference/array/functions/each.xml:1.8 phpdoc-de/reference/array/functions/each.xml:1.9 --- phpdoc-de/reference/array/functions/each.xml:1.8 Fri Feb 7 17:58:46 2003 +++ phpdoc-de/reference/array/functions/each.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> -<!-- EN-Revision: 1.8 Maintainer: tom Status: ready --> +<!-- $Revision: 1.9 $ --> +<!-- EN-Revision: 1.11 Maintainer: tom Status: ready --> <refentry id="function.each"> <refnamediv> <refname>each</refname> @@ -34,14 +34,17 @@ <title><function>each</function> Beispiele</title> <programlisting role="php"> <![CDATA[ +<?php $foo = array ("bob", "fred", "jussi", "jouni", "egon", "marliese"); $bar = each ($foo); print_r($bar); +?> ]]> </programlisting> <para> <varname>$bar</varname> enthält nun die folgenden Schlüssel/Wert Paare: + </para> <screen> <![CDATA[ Array @@ -53,18 +56,24 @@ ) ]]> </screen> - <programlisting role="php"> + </example> + </para> + <para> + <informalexample> + <programlisting role="php"> <![CDATA[ +<?php $foo = array ("Robert" => "Bob", "Seppo" => "Sepi"); $bar = each ($foo); print_r($bar); +?> ]]> - </programlisting> - </para> + </programlisting> <para> <varname>$bar</varname> enthält nun die folgenden Schlüssel/Wert Paare: - <screen> + </para> + <screen> <![CDATA[ Array ( @@ -74,26 +83,32 @@ [key] => Robert ) ]]> - </screen> - </para> - </example> + </screen> + </informalexample> </para> <para> <function>each</function> wird typischerweise in Verbindung mit - <function>list</function> verwendet, um ein Array durchzugehen; - zum Beispiel <varname>$_POST</varname>: + <function>list</function> verwendet, um ein Array durchzugehen: <example> - <title> - Durchgehen von <varname>$_POST</varname> mit - <function>each</function> - </title> + <title>Durchgehen eines Arrays mit <function>each</function></title> <programlisting role="php"> <![CDATA[ -echo "Werte, die mit der POST Methode übertragen wurden:<br />"; -reset ($_POST); -while (list ($key, $val) = each ($_POST)) { - echo "$key => $val<br />\n"; +<?php +$fruit = array('a' => 'Apfel', 'b' => 'Banane', 'c' => 'Preiselbeere'); + +reset ($fruit); +while (list ($key, $val) = each ($fruit)) { + echo "$key => $val\n"; } + +/* Ausgabe: + +a => Apfel +b => Banane +c => Preiselbeere + +*/ +?> ]]> </programlisting> </example> @@ -101,10 +116,18 @@ <para> Nachdem <function>each</function> ausgeführt wurde, bleibt der Array Cursor beim nächsten Element des Arrays, oder wenn am Ende - des Arrays angelangt, bei dem letzten Element. Sie müssen + des Arrays angelangt, nach dem letzten Element. Sie müssen <function>reset</function> verwenden, wenn Sie das Array erneut mittels each durchgehen wollen. </para> + <caution> + <para> + Da die Zuweisung eines Arrays zu einer anderen Variable den originalen + Arrayzeiger zurücksetzt, würde unser obiges Beispiel in eine Endlosschleife + geraten, hätten wir <varname>$fruit</varname> innerhalb der Schleife + einer anderen Variable zugeordnet. + </para> + </caution> <para> Siehe auch <function>key</function>, <function>list</function>, <function>current</function>, <function>reset</function>, Index: phpdoc-de/reference/array/functions/extract.xml diff -u phpdoc-de/reference/array/functions/extract.xml:1.7 phpdoc-de/reference/array/functions/extract.xml:1.8 --- phpdoc-de/reference/array/functions/extract.xml:1.7 Fri Feb 7 17:58:46 2003 +++ phpdoc-de/reference/array/functions/extract.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- EN-Revision: 1.8 Maintainer: tom Status: ready --> +<!-- $Revision: 1.8 $ --> +<!-- EN-Revision: 1.9 Maintainer: tom Status: ready --> <refentry id="function.extract"> <refnamediv> <refname>extract</refname> @@ -177,15 +177,15 @@ ?> ]]> </programlisting> - </example> - </para> - <para> - Das obige Beispiel wird folgendes ausgeben: - <programlisting> + <para> + Das obige Beispiel wird folgendes ausgeben: + </para> + <programlisting> <![CDATA[ blau, groß, Kugel, mittel ]]> - </programlisting> + </programlisting> + </example> </para> <para> <varname>$size</varname> wurde nicht überschrieben, da wir Index: phpdoc-de/reference/array/functions/in-array.xml diff -u phpdoc-de/reference/array/functions/in-array.xml:1.5 phpdoc-de/reference/array/functions/in-array.xml:1.6 --- phpdoc-de/reference/array/functions/in-array.xml:1.5 Sun Oct 6 16:40:51 2002 +++ phpdoc-de/reference/array/functions/in-array.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.5 Maintainer: tom Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.8 Maintainer: tom Status: ready --> <refentry id="function.in-array"> <refnamediv> <refname>in_array</refname> @@ -42,6 +42,7 @@ <title><function>in_array</function></title> <programlisting role="php"> <![CDATA[ +<?php $os = array ("Mac", "NT", "Irix", "Linux"); if (in_array ("Irix", $os)) { print "Got Irix"; @@ -49,18 +50,19 @@ if (in_array ("mac", $os)) { print "Got mac"; } +?> ]]> </programlisting> <para> Die zweite Bedingung schlägt fehl, da <function>in_array</function> die Groß-/Kleinschreibung berücksichtigt, daher wird das obige Programm folgendes ausgeben: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Got Irix ]]> - </screen> - </para> + </screen> </example> </para> <para> @@ -71,21 +73,23 @@ <?php $a = array('1.10', 12.4, 1.13); -if (in_array('12.4', $a, TRUE)) +if (in_array('12.4', $a, TRUE)) { echo "'12.4' gefunden mit strict check\n"; -if (in_array(1.13, $a, TRUE)) +} +if (in_array(1.13, $a, TRUE)) { echo "1.13 gefunden mit strict check\n"; +} ?> ]]> </programlisting> <para> Dies wird folgendes anzeigen: - <screen role="php"> + </para> + <screen> <![CDATA[ 1.13 gefunden mit strict check ]]> - </screen> - </para> + </screen> </example> </para> <para> @@ -96,18 +100,22 @@ <?php $a = array(array('p', 'h'), array('p', 'r'), 'o'); -if (in_array(array ('p', 'h'), $a)) +if (in_array(array ('p', 'h'), $a)) { echo "'ph' wurde gefunden\n"; -if (in_array(array ('f', 'i'), $a)) +} +if (in_array(array ('f', 'i'), $a)) { echo "'fi' wurde nicht gefunden\n"; -if (in_array('o', $a)) +} +if (in_array('o', $a)) { echo "'o' wurde gefunden\n"; +} ?> -// Dies wird folgendes anzeigen: +/* Ausgabe: -'ph' wurde gefunden -'o' wurde gefunden + 'ph' wurde gefunden + 'o' wurde gefunden +*/ ]]> </programlisting> </example> Index: phpdoc-de/reference/array/functions/krsort.xml diff -u phpdoc-de/reference/array/functions/krsort.xml:1.4 phpdoc-de/reference/array/functions/krsort.xml:1.5 --- phpdoc-de/reference/array/functions/krsort.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/krsort.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: tom Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.6 Maintainer: tom Status: ready --> <refentry id="function.krsort"> <refnamediv> <refname>krsort</refname> @@ -20,32 +20,34 @@ wobei die Zuordnungen zwischen Schlüssel und Wert erhalten bleiben. Dies ist hauptsächlich bei assoziativen Arrays hilfreich. + </para> + <para> <example> <title><function>krsort</function></title> <programlisting role="php"> <![CDATA[ +<?php $fruits = array ("d"=>"Zitrone", "a"=>"Orange", "b"=>"Banane", "c"=>"Apfel"); krsort ($fruits); reset ($fruits); while (list ($key, $val) = each ($fruits)) { echo "$key = $val\n"; } +?> ]]> </programlisting> - </example> - </para> - <para> - Dieses Beispiel würde folgendes ausgeben: - </para> - <para> - <screen> + <para> + Dieses Beispiel würde folgendes ausgeben: + </para> + <screen> <![CDATA[ d = Zitrone c = Apfel b = Banane a = Orange ]]> - </screen> + </screen> + </example> </para> <para> Sie können das Verhalten der Sortierung mittels dem optionalen Index: phpdoc-de/reference/array/functions/ksort.xml diff -u phpdoc-de/reference/array/functions/ksort.xml:1.4 phpdoc-de/reference/array/functions/ksort.xml:1.5 --- phpdoc-de/reference/array/functions/ksort.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/ksort.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: tom Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.6 Maintainer: tom Status: ready --> <refentry id="function.ksort"> <refnamediv> <refname>ksort</refname> @@ -17,32 +17,34 @@ Sortiert ein Array nach Schlüsseln, wobei die Zuordnungen zwischen Schlüssel und Wert erhalten bleiben. Dies ist hauptsächlich bei assoziativen Arrays hilfreich. + </para> + <para> <example> <title><function>ksort</function></title> <programlisting role="php"> <![CDATA[ +<?php $fruits = array ("d"=>"Zitrone", "a"=>"Orange", "b"=>"Banane", "c"=>"Apfel"); ksort ($fruits); reset ($fruits); while (list ($key, $val) = each ($fruits)) { echo "$key = $val\n"; } +?> ]]> </programlisting> - </example> - </para> - <para> - Dieses Beispiel würde folgendes ausgeben: - </para> - <para> - <screen> + <para> + Dieses Beispiel würde folgendes ausgeben: + </para> + <screen> <![CDATA[ a = Orange b = Banane c = Apfel d = Zitrone ]]> - </screen> + </screen> + </example> </para> <para> Sie können das Verhalten der Sortierung mittels dem optionalen Index: phpdoc-de/reference/array/functions/list.xml diff -u phpdoc-de/reference/array/functions/list.xml:1.5 phpdoc-de/reference/array/functions/list.xml:1.6 --- phpdoc-de/reference/array/functions/list.xml:1.5 Sun Oct 6 16:40:51 2002 +++ phpdoc-de/reference/array/functions/list.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.7 Maintainer: tom Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.8 Maintainer: tom Status: ready --> <refentry id="function.list"> <refnamediv> <refname>list</refname> @@ -10,10 +10,10 @@ </refnamediv> <refsect1> <title>Beschreibung</title> - <methodsynopsis> - <type>void</type><methodname>list</methodname> - <methodparam rep="repeat"><type>mixed</type><parameter>...</parameter></methodparam> - </methodsynopsis> + <methodsynopsis> + <type>void</type><methodname>list</methodname> + <methodparam rep="repeat"><type>mixed</type><parameter>...</parameter></methodparam> + </methodsynopsis> <para> Wie <function>array</function> ist auch dies keine wirkliche Funktion, sondern ein Sprachkonstrukt. <function>list</function> @@ -81,15 +81,15 @@ </example> </para> <warning> - <para> - <function>list</function> weist die Werte von rechts beginnend zu. - Wenn Sie einfache Variablen benutzen, brauchen Sie sich nicht darum - zu kümmern. Wenn Sie jedoch Arrays mit Indizes verwenden, erwarten Sie - gewöhnlich die Reihenfolge der Indizes in dem Array genau so, wie Sie - sie in <function>list</function> geschrieben haben (von links nach - rechts), was jedoch nicht der Fall ist. Es wird in der umgekehrten - Reihenfolge zugewiesen. - </para> + <para> + <function>list</function> weist die Werte von rechts beginnend zu. + Wenn Sie einfache Variablen benutzen, brauchen Sie sich nicht darum + zu kümmern. Wenn Sie jedoch Arrays mit Indizes verwenden, erwarten Sie + gewöhnlich die Reihenfolge der Indizes in dem Array genau so, wie Sie + sie in <function>list</function> geschrieben haben (von links nach + rechts), was jedoch nicht der Fall ist. Es wird in der umgekehrten + Reihenfolge zugewiesen. + </para> </warning> <para> <example> @@ -107,10 +107,12 @@ ?> ]]> </programlisting> - </example> - Die Ausgabe (Beachten Sie die Reihenfolge der Elemente, verglichen mit - der in <function>list</function> eingetragenen Reihenfolge): - <screen> + <para> + Die Ausgabe (Beachten Sie die Reihenfolge der Elemente, verglichen mit + der in <function>list</function> eingetragenen Reihenfolge): + </para> + <screen> +<![CDATA[ array(3) { [2]=> string(8) "caffeine" @@ -119,7 +121,9 @@ [0]=> string(6) "coffee" } - </screen> +]]> + </screen> + </example> </para> <para> Siehe auch <function>each</function>, <function>array</function> Index: phpdoc-de/reference/array/functions/natsort.xml diff -u phpdoc-de/reference/array/functions/natsort.xml:1.5 phpdoc-de/reference/array/functions/natsort.xml:1.6 --- phpdoc-de/reference/array/functions/natsort.xml:1.5 Sun Oct 6 16:40:51 2002 +++ phpdoc-de/reference/array/functions/natsort.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.5 Maintainer: tom Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.7 Maintainer: tom Status: ready --> <refentry id="function.natsort"> <refnamediv> <refname>natsort</refname> @@ -38,13 +38,10 @@ ?> ]]> </programlisting> - </example> - </para> - <para> - Der obige Code wird folgendes anzeigen: - </para> - <para> - <screen> + <para> + Der obige Code wird folgendes anzeigen: + </para> + <screen> <![CDATA[ Standardsortierung Array @@ -64,15 +61,18 @@ [0] => img12.png ) ]]> - </screen> - Detailliertere Informationen finden Sie auf Martin Pool's <ulink - url="&url.strnatcmp;">Natural Order String Comparison</ulink> - Seite. + </screen> + <para> + Detailliertere Informationen finden Sie auf Martin Pool's <ulink + url="&url.strnatcmp;">Natural Order String Comparison</ulink> + Seite. + </para> + </example> </para> <note> <para> Wenn Sie die Index/Wert Assoziationen beibehalten wollen, denken Sie - an die Verwendung von <literal>usort($arr, 'strnatcmp')</literal>. + an die Verwendung von <literal>uasort($arr, 'strnatcmp')</literal>. </para> </note> <para> Index: phpdoc-de/reference/array/functions/range.xml diff -u phpdoc-de/reference/array/functions/range.xml:1.8 phpdoc-de/reference/array/functions/range.xml:1.9 --- phpdoc-de/reference/array/functions/range.xml:1.8 Fri Feb 7 17:58:46 2003 +++ phpdoc-de/reference/array/functions/range.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> -<!-- EN-Revision: 1.8 Maintainer: tom Status: ready --> +<!-- $Revision: 1.9 $ --> +<!-- EN-Revision: 1.9 Maintainer: tom Status: ready --> <refentry id="function.range"> <refnamediv> <refname>range</refname> @@ -40,8 +40,8 @@ <programlisting role="php"> <![CDATA[ <?php -// array(0,1,2,3,4,5,6,7,8,9) -foreach(range(0, 9) as $number) { +// array(0,1,2,3,4,5,6,7,8,9,10,11,12) +foreach(range(0, 12) as $number) { echo $number; } @@ -51,7 +51,7 @@ echo $number; } -// Die Verwendung von Zeichen wurde in 4.1.0 eingeführt +// Die Verwendung von Zeichenfolgen wurde in 4.1.0 eingeführt // array('a','b','c','d','e','f','g','h','i'); foreach(range('a', 'i') as $letter) { echo $letter; @@ -69,9 +69,19 @@ <para> Vor der Version 4.1.0 hat die Funktion <function>range</function> nur aufsteigende Integer Arrays erstellt. Die Unterstützung für Zeichenfolgen - und Arrays in absteigender Reihenfolge wurde in 4.1.0 hinzugefügt. + und Arrays in absteigender Reihenfolge wurde in 4.1.0 hinzugefügt. Werte + mit Zeichenfolgen sind auf eine Länge von 1 limitiert. Wird eine Länge + größer als 1 eingegeben, wird nur das erste Zeichen verwendet. </para> </note> + <caution> + <para> + In den PHP Versionen 4.1.0 bis 4.3.2 werden numerische Zeichenfolgen von + <function>range</function> als Strings, und nicht als integer gesehen. + Stattdessen werden diese für Zeichenfolgen genutzt, z.B. wird + <literal>"4242"</literal> als <literal>"4"</literal> betrachtet. + </para> + </caution> <para> Siehe auch <function>shuffle</function> und <link linkend="control-structures.foreach">foreach</link>. Index: phpdoc-de/reference/array/functions/reset.xml diff -u phpdoc-de/reference/array/functions/reset.xml:1.4 phpdoc-de/reference/array/functions/reset.xml:1.5 --- phpdoc-de/reference/array/functions/reset.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/reset.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: tom Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.5 Maintainer: tom Status: ready --> <refentry id="function.reset"> <refnamediv> <refname>reset</refname> @@ -16,11 +16,8 @@ </methodsynopsis> <para> <function>reset</function> setzt den internen Zeiger von - <parameter>array</parameter> auf das erste Element zurück. - </para> - <para> - <function>reset</function> gibt den Wert des ersten Arrayelements - zurück. + <parameter>array</parameter> auf das erste Element, und gibt den Wert + des ersten Arrayelements zurück. </para> <para> Siehe auch <function>current</function>, Index: phpdoc-de/reference/array/functions/rsort.xml diff -u phpdoc-de/reference/array/functions/rsort.xml:1.4 phpdoc-de/reference/array/functions/rsort.xml:1.5 --- phpdoc-de/reference/array/functions/rsort.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/rsort.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: tom Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.6 Maintainer: tom Status: ready --> <refentry id="function.rsort"> <refnamediv> <refname>rsort</refname> @@ -18,32 +18,34 @@ <para> Diese Funktion sortiert ein Array in umgekehrter Reihenfolge (vom höchsten zum niedrigsten Wert). + </para> + <para> <example> <title><function>rsort</function></title> <programlisting role="php"> <![CDATA[ +<?php $fruits = array ("Zitrone", "Orange", "Banane", "Apfel"); rsort ($fruits); reset ($fruits); while (list ($key, $val) = each ($fruits)) { echo "$key = $val\n"; } +?> ]]> </programlisting> - </example> - </para> - <para> - Dieses Beispiel würde folgendes ausgeben: - </para> - <para> - <screen> + <para> + Dieses Beispiel würde folgendes ausgeben: + </para> + <screen> <![CDATA[ 0 = Zitrone 1 = Orange 2 = Banane 3 = Apfel ]]> - </screen> + </screen> + </example> </para> <para> Die Früchte wurden in umgekehrter alphabetischer Reihenfolge Index: phpdoc-de/reference/array/functions/shuffle.xml diff -u phpdoc-de/reference/array/functions/shuffle.xml:1.4 phpdoc-de/reference/array/functions/shuffle.xml:1.5 --- phpdoc-de/reference/array/functions/shuffle.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/shuffle.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: tom Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.6 Maintainer: tom Status: ready --> <refentry id="function.shuffle"> <refnamediv> <refname>shuffle</refname> @@ -20,16 +20,21 @@ <title><function>shuffle</function></title> <programlisting role="php"> <![CDATA[ +<?php $numbers = range (1,20); srand ((float)microtime()*1000000); shuffle ($numbers); while (list (, $number) = each ($numbers)) { echo "$number "; } +?> ]]> </programlisting> </example> </para> + + &note.randomseed; + <para> Siehe auch <function>arsort</function>, <function>asort</function>, <function>ksort</function>, Index: phpdoc-de/reference/array/functions/sizeof.xml diff -u phpdoc-de/reference/array/functions/sizeof.xml:1.4 phpdoc-de/reference/array/functions/sizeof.xml:1.5 --- phpdoc-de/reference/array/functions/sizeof.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/sizeof.xml Sun Jun 29 03:44:02 2003 @@ -1,23 +1,15 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: tom Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.5 Maintainer: tom Status: ready --> <refentry id="function.sizeof"> <refnamediv> <refname>sizeof</refname> - <refpurpose>Liefert die Anzahl Elemente einer Variable</refpurpose> + <refpurpose>Alias für <function>count</function></refpurpose> </refnamediv> <refsect1> <title>Beschreibung</title> - <methodsynopsis> - <type>int</type><methodname>sizeof</methodname> - <methodparam><type>mixed</type><parameter>var</parameter></methodparam> - </methodsynopsis> <para> - Die Funktion <function>sizeof</function> ist ein - <link linkend="aliases">Alias</link> für <function>count</function>. - </para> - <para> - Siehe auch <function>count</function>. + Diese Funktion ist ein Alias für <function>count</function>. </para> </refsect1> </refentry> Index: phpdoc-de/reference/array/functions/sort.xml diff -u phpdoc-de/reference/array/functions/sort.xml:1.4 phpdoc-de/reference/array/functions/sort.xml:1.5 --- phpdoc-de/reference/array/functions/sort.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/sort.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.4 Maintainer: tom Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.6 Maintainer: tom Status: ready --> <refentry id="function.sort"> <refnamediv> <refname>sort</refname> @@ -16,6 +16,8 @@ <para> Diese Funktion sortiert ein Array. Die Elemente werden aufsteigend vom niedrigsten zum höchsten Wert sortiert. + </para> + <para> <example> <title><function>sort</function></title> <programlisting role="php"> @@ -32,20 +34,18 @@ ?> ]]> </programlisting> - </example> - </para> - <para> - Dieses Beispiel würde folgendes anzeigen: - </para> - <para> - <screen> + <para> + Dieses Beispiel würde folgendes anzeigen: + </para> + <screen> <![CDATA[ fruits[0] = Apfel fruits[1] = Banane fruits[2] = Orange fruits[3] = Zitrone ]]> - </screen> + </screen> + </example> </para> <para> Die Früchte wurden in alphabetischer Reihenfolge sortiert. @@ -69,6 +69,11 @@ </listitem> </itemizedlist> </para> + <note> + <para> + Der zweite Parameter wurde in PHP 4 eingeführt. + </para> + </note> <para> Siehe auch <function>arsort</function>, <function>asort</function>, <function>ksort</function>, @@ -77,11 +82,6 @@ <function>array_multisort</function> und <function>uksort</function>. </para> - <note> - <para> - Der zweite Parameter wurde in PHP 4 eingeführt. - </para> - </note> </refsect1> </refentry> Index: phpdoc-de/reference/array/functions/uksort.xml diff -u phpdoc-de/reference/array/functions/uksort.xml:1.5 phpdoc-de/reference/array/functions/uksort.xml:1.6 --- phpdoc-de/reference/array/functions/uksort.xml:1.5 Sat Jan 11 10:19:37 2003 +++ phpdoc-de/reference/array/functions/uksort.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> -<!-- EN-Revision: 1.5 Maintainer: tom Status: ready --> +<!-- $Revision: 1.6 $ --> +<!-- EN-Revision: 1.7 Maintainer: tom Status: ready --> <refentry id="function.uksort"> <refnamediv> <refname>uksort</refname> @@ -22,6 +22,7 @@ trivialen Kriterien sortiert werden, sollten Sie diese Funktion verwenden. </para> + <para> <example> <title><function>uksort</function></title> <programlisting role="php"> @@ -40,19 +41,18 @@ } ]]> </programlisting> - </example> - <para> - Dieses Beispiel würde folgendes ausgeben: - </para> - <para> - <screen> + <para> + Dieses Beispiel würde folgendes ausgeben: + </para> + <screen> <![CDATA[ 20: zwanzig 10: zehn 4: vier 3: drei ]]> - </screen> + </screen> + </example> </para> <para> Siehe auch <function>usort</function>, <function>uasort</function>, Index: phpdoc-de/reference/array/functions/usort.xml diff -u phpdoc-de/reference/array/functions/usort.xml:1.7 phpdoc-de/reference/array/functions/usort.xml:1.8 --- phpdoc-de/reference/array/functions/usort.xml:1.7 Fri Feb 7 17:58:46 2003 +++ phpdoc-de/reference/array/functions/usort.xml Sun Jun 29 03:44:02 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- EN-Revision: 1.8 Maintainer: tom Status: ready --> +<!-- $Revision: 1.8 $ --> +<!-- EN-Revision: 1.11 Maintainer: tom Status: ready --> <refentry id="function.usort"> <refnamediv> <refname>usort</refname> @@ -27,6 +27,8 @@ kleiner, gleich, oder größer ist als &null;, wenn für das erste Argument auch angenommen wird, dass es kleiner, gleich, oder größer ist als das zweite. + </para> + <para> <note> <para> Sind zwei Elemente gleich, ist deren Reihenfolge nicht definiert. Bis zu @@ -42,9 +44,10 @@ <title><function>usort</function></title> <programlisting role="php"> <![CDATA[ +<?php function cmp ($a, $b) { if ($a == $b) return 0; - return ($a > $b) ? -1 : 1; + return ($a < $b) ? -1 : 1; } $a = array (3, 2, 5, 6, 1); @@ -54,38 +57,37 @@ while (list ($key, $value) = each ($a)) { echo "$key: $value\n"; } +?> ]]> </programlisting> - </example> - </para> - <para> - Dieses Beispiel würde folgendes anzeigen: - </para> - <para> - <screen> + <para> + Dieses Beispiel würde folgendes anzeigen: + </para> + <screen> <![CDATA[ -0: 6 -1: 5 +0: 1 +1: 2 2: 3 -3: 2 -4: 1 +3: 5 +4: 6 ]]> - </screen> + </screen> + </example> </para> <note> <para> - Offensichtlich würde <function>rsort</function> für diesen + Offensichtlich würde <function>sort</function> für diesen einfachen Fall besser passen. </para> </note> <para> <example> <title> - <function>usort</function> Beispiel mit einem mehrdimensionalen - Array + <function>usort</function> mit einem mehrdimensionalen Array </title> <programlisting role="php"> <![CDATA[ +<?php function cmp ($a, $b) { return strcmp($a["fruit"], $b["fruit"]); } @@ -99,25 +101,24 @@ while (list ($key, $value) = each ($fruits)) { echo "\$fruits[$key]: " . $value["fruit"] . "\n"; } +?> ]]> </programlisting> - </example> - </para> - <para> - Wird ein mehrdimensionales Array sortiert, enthalten $a und $b - Referenzen zu dem ersten Index des Arrays. - </para> - <para> - Dieses Beispiel würde folgendes anzeigen: - </para> - <para> - <screen> + <para> + Wird ein mehrdimensionales Array sortiert, enthalten $a und $b + Referenzen zu dem ersten Index des Arrays. + </para> + <para> + Dieses Beispiel würde folgendes anzeigen: + </para> + <screen> <![CDATA[ $fruits[0]: Äpfel $fruits[1]: Trauben $fruits[2]: Zitronen ]]> - </screen> + </screen> + </example> </para> <para> @@ -127,6 +128,7 @@ </title> <programlisting role="php"> <![CDATA[ +<?php class TestObj { var $name; @@ -154,21 +156,20 @@ foreach ($a as $item) { print $item->name."\n"; } +?> ]]> </programlisting> - </example> - </para> - <para> - Dieses Beispiel würde folgendes anzeigen: - </para> - <para> - <screen> + <para> + Dieses Beispiel würde folgendes anzeigen: + </para> + <screen> <![CDATA[ b c d ]]> - </screen> + </screen> + </example> </para> <para>
« previous php.doc.de (#818) next »