cvs: phpdoc-de /reference/array reference.xml /reference/array/functions array-change-key-case.xml array-chunk.xml array-count-values.xml
array-diff.xml array-fill.xml array-filter.xml array-flip.xml array-intersect.xml array-key-exists.xml array-keys.xml array-map.xml
array-merge-recursive.xml array-merge.xml array-multisort.xml array-pad.xml array-pop.xml array-push.xml array-rand.xml array-reduce.xml

From: Date: Sat, 28 Jun 2003 20:21:25 +0000
Subject: cvs: phpdoc-de /reference/array reference.xml /reference/array/functions array-change-key-case.xml array-chunk.xml array-count-values.xml
array-diff.xml array-fill.xml array-filter.xml array-flip.xml array-intersect.xml array-key-exists.xml array-keys.xml array-map.xml
array-merge-recursive.xml array-merge.xml array-multisort.xml array-pad.xml array-pop.xml array-push.xml array-rand.xml array-reduce.xml
Groups: php.doc.de 
Request: Send a blank email to doc-de+get-814@lists.php.net to get a copy of this message
tom Sat Jun 28 16:21:25 2003 EDT Modified files: /phpdoc-de/reference/array reference.xml /phpdoc-de/reference/array/functions array-change-key-case.xml array-chunk.xml array-count-values.xml array-diff.xml array-fill.xml array-filter.xml array-flip.xml array-intersect.xml array-key-exists.xml array-keys.xml array-map.xml array-merge-recursive.xml array-merge.xml array-multisort.xml array-pad.xml array-pop.xml array-push.xml array-rand.xml array-reduce.xml Log: sync to en

Index: phpdoc-de/reference/array/reference.xml diff -u phpdoc-de/reference/array/reference.xml:1.6 phpdoc-de/reference/array/reference.xml:1.7 --- phpdoc-de/reference/array/reference.xml:1.6 Sat Oct 5 18:45:55 2002 +++ phpdoc-de/reference/array/reference.xml Sat Jun 28 16:21:25 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.8 Maintainer: tom Status: ready --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.10 Maintainer: tom Status: ready --> <reference id="ref.array"> <title>Array Funktionen</title> <titleabbrev>Arrays</titleabbrev> @@ -56,7 +56,7 @@ <para> Siehe auch <function>is_array</function>, <function>explode</function>, <function>implode</function>, <function>split</function>, - <function>preg_split</function> und <function>join</function>. + <function>preg_split</function> und <function>unset</function>. </para> </section> </partintro> Index: phpdoc-de/reference/array/functions/array-change-key-case.xml diff -u phpdoc-de/reference/array/functions/array-change-key-case.xml:1.5 phpdoc-de/reference/array/functions/array-change-key-case.xml:1.6 --- phpdoc-de/reference/array/functions/array-change-key-case.xml:1.5 Sat Jan 11 04:46:22 2003 +++ phpdoc-de/reference/array/functions/array-change-key-case.xml Sat Jun 28 16:21:25 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-change-key-case"> <refnamediv> <refname>array_change_key_case</refname> @@ -28,23 +28,30 @@ <title><function>array_change_key_case</function></title> <programlisting role="php"> <![CDATA[ +<?php $input_array = array("FirSt" => 1, "SecOnd" => 4); print_r(array_change_key_case($input_array, CASE_UPPER)); +?> ]]> </programlisting> <para> wird folgendes ausgeben: - <screen> + </para> + <screen> <![CDATA[ Array ( [FIRST] => 1 - [SECOND] => 2 + [SECOND] => 4 ) ]]> - </screen> - </para> + </screen> </example> + <para> + Hat ein Array Indices, die bei einem Durchlauf durch diese Funktion gleich + sind (z.B. "keY" and "kEY"), hebt der letztere Wert im Array andere + Indices auf. + </para> </refsect1> </refentry> Index: phpdoc-de/reference/array/functions/array-chunk.xml diff -u phpdoc-de/reference/array/functions/array-chunk.xml:1.5 phpdoc-de/reference/array/functions/array-chunk.xml:1.6 --- phpdoc-de/reference/array/functions/array-chunk.xml:1.5 Sat Jan 11 04:46:23 2003 +++ phpdoc-de/reference/array/functions/array-chunk.xml Sat Jun 28 16:21:25 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.8 Maintainer: tom Status: ready --> <refentry id="function.array-chunk"> <refnamediv> <refname>array_chunk</refname> @@ -32,13 +32,16 @@ <title><function>array_chunk</function></title> <programlisting role="php"> <![CDATA[ +<?php $input_array = array('a', 'b', 'c', 'd', 'e'); print_r(array_chunk($input_array, 2)); print_r(array_chunk($input_array, 2, TRUE)); +?> ]]> </programlisting> <para> wird folgendes ausgeben: + </para> <screen> <![CDATA[ Array @@ -83,7 +86,6 @@ ) ]]> </screen> - </para> </example> </refsect1> </refentry> Index: phpdoc-de/reference/array/functions/array-count-values.xml diff -u phpdoc-de/reference/array/functions/array-count-values.xml:1.5 phpdoc-de/reference/array/functions/array-count-values.xml:1.6 --- phpdoc-de/reference/array/functions/array-count-values.xml:1.5 Sat Jan 11 04:46:23 2003 +++ phpdoc-de/reference/array/functions/array-count-values.xml Sat Jun 28 16:21:25 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.8 Maintainer: tom Status: ready --> <refentry id="function.array-count-values"> <refnamediv> <refname>array_count_values</refname> @@ -22,13 +22,16 @@ <title><function>array_count_values</function></title> <programlisting role="php"> <![CDATA[ +<?php $array = array (1, "hello", 1, "world", "hello"); print_r(array_count_values ($array)); +?> ]]> </programlisting> <para> Wird folgendes ausgeben: - <screen> + </para> + <screen> <![CDATA[ Array ( @@ -37,8 +40,7 @@ [world] => 1 ) ]]> - </screen> - </para> + </screen> </example> </para> </refsect1> Index: phpdoc-de/reference/array/functions/array-diff.xml diff -u phpdoc-de/reference/array/functions/array-diff.xml:1.6 phpdoc-de/reference/array/functions/array-diff.xml:1.7 --- phpdoc-de/reference/array/functions/array-diff.xml:1.6 Sat Jan 11 10:19:37 2003 +++ phpdoc-de/reference/array/functions/array-diff.xml Sat Jun 28 16:21:25 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-diff"> <refnamediv> <refname>array_diff</refname> Index: phpdoc-de/reference/array/functions/array-fill.xml diff -u phpdoc-de/reference/array/functions/array-fill.xml:1.5 phpdoc-de/reference/array/functions/array-fill.xml:1.6 --- phpdoc-de/reference/array/functions/array-fill.xml:1.5 Fri Feb 7 17:58:46 2003 +++ phpdoc-de/reference/array/functions/array-fill.xml Sat Jun 28 16:21:25 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.array-fill"> <refnamediv> <refname>array_fill</refname> @@ -19,19 +19,24 @@ <parameter>num</parameter> Einträgen des Wertes des <parameter>value</parameter> Parameters. Die Indizes des Arrays beginnen mit dem <parameter>start_index</parameter> Parameter. + Beachten Sie, dass <parameter>num</parameter> eine Zahl größer als + Null sein muss, ansonsten gibt PHP eine Warnung aus. </para> <para> <example> <title><function>array_fill</function></title> <programlisting role="php"> <![CDATA[ +<?php $a = array_fill(5, 6, 'Banane'); print_r($a); +?> ]]> </programlisting> <para> Nun ist <varname>$a</varname>: - <screen> + </para> + <screen> <![CDATA[ Array ( @@ -43,8 +48,7 @@ [10] => Banane ) ]]> - </screen> - </para> + </screen> </example> </para> </refsect1> Index: phpdoc-de/reference/array/functions/array-filter.xml diff -u phpdoc-de/reference/array/functions/array-filter.xml:1.5 phpdoc-de/reference/array/functions/array-filter.xml:1.6 --- phpdoc-de/reference/array/functions/array-filter.xml:1.5 Sat Jan 11 04:46:23 2003 +++ phpdoc-de/reference/array/functions/array-filter.xml Sat Jun 28 16:21:25 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.11 Maintainer: tom Status: ready --> <refentry id="function.array-filter"> <refnamediv> <refname>array_filter</refname> @@ -16,17 +16,18 @@ <methodparam choice="opt"><type>callback</type><parameter>function</parameter></methodparam> </methodsynopsis> <para> - <function>array_filter</function> gibt ein Array mit den mittels - der Callback-Funktion <parameter>function</parameter> gefilterten - Elementen von<parameter>input</parameter> zurück. Ist - <parameter>input</parameter> ein assoziatives Array, bleiben die - Schlüssel erhalten. + <function>array_filter</function> übergibt nacheinander alle Werte in dem + Array <parameter>input</parameter> and die <parameter>callback</parameter> + Funktion. Gibt die <parameter>callback</parameter> Funktion true zurück, + wird der aktuelle Wert von <parameter>input</parameter> in das Ergebnis-Array + geschrieben. Die Schlüssel des Arrays bleiben erhalten. </para> <para> <example> <title><function>array_filter</function></title> <programlisting role="php"> <![CDATA[ +<?php function ungerade($var) { return ($var % 2 == 1); } @@ -42,11 +43,13 @@ print_r(array_filter($array1, "ungerade")); echo "Gerade:\n"; print_r(array_filter($array2, "gerade")); +?> ]]> </programlisting> <para> Wird folgendes ausgeben: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Ungerade : Array @@ -64,8 +67,7 @@ [6] => 12 ) ]]> - </screen> - </para> + </screen> </example> </para> <para> @@ -76,8 +78,8 @@ geändert, so ist das Verhalten dieser Funktion undefiniert. </para> <para> - Siehe auch <function>array_map</function> und - <function>array_reduce</function>. + Siehe auch <function>array_map</function>, + <function>array_reduce</function> und <function>array_walk</function>. </para> </refsect1> </refentry> Index: phpdoc-de/reference/array/functions/array-flip.xml diff -u phpdoc-de/reference/array/functions/array-flip.xml:1.6 phpdoc-de/reference/array/functions/array-flip.xml:1.7 --- phpdoc-de/reference/array/functions/array-flip.xml:1.6 Fri Feb 7 17:58:46 2003 +++ phpdoc-de/reference/array/functions/array-flip.xml Sat Jun 28 16:21:25 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.9 Maintainer: tom Status: ready --> <refentry id="function.array-flip"> <refnamediv> <refname>array_flip</refname> @@ -13,10 +13,10 @@ <methodparam><type>array</type><parameter>trans</parameter></methodparam> </methodsynopsis> <para> - <function>array_flip</function> Gibt ein <type>Array</type> in - umgekehrter Reihenfolge zurück, d.h. Schlüssel von - <parameter>trans</parameter> werden Werte, und umgekehrt werden - die Werte zu Schlüsseln. + <function>array_flip</function> gibt ein <type>Array</type> + in umgekehrter Reihenfolge zurück, d.h. Schlüssel von + <parameter>trans</parameter> werden Werte, und die Werte + von <parameter>trans</parameter> werden zu Schlüsseln. </para> <para> Beachten Sie, dass die Werte von <parameter>trans</parameter> gültige @@ -36,28 +36,33 @@ </para> <para> <example> - <title><function>array_flip</function> Beispiel</title> + <title><function>array_flip</function></title> <programlisting role="php"> <![CDATA[ +<?php $trans = array_flip ($trans); $original = strtr ($str, $trans); +?> ]]> </programlisting> </example> </para> <para> <example> - <title><function>array_flip</function> Beispiel: Kollision</title> + <title><function>array_flip</function>: Kollision</title> <programlisting role="php"> <![CDATA[ +<?php $trans = array ("a" => 1, "b" => 1, "c" => 2); $trans = array_flip ($trans); print_r($trans); +?> ]]> </programlisting> <para> Nun ist <varname>$trans</varname>: - <screen> + </para> + <screen> <![CDATA[ Array ( @@ -65,8 +70,7 @@ [2] => c ) ]]> - </screen> - </para> + </screen> </example> </para> </refsect1> Index: phpdoc-de/reference/array/functions/array-intersect.xml diff -u phpdoc-de/reference/array/functions/array-intersect.xml:1.5 phpdoc-de/reference/array/functions/array-intersect.xml:1.6 --- phpdoc-de/reference/array/functions/array-intersect.xml:1.5 Sat Jan 11 10:19:37 2003 +++ phpdoc-de/reference/array/functions/array-intersect.xml Sat Jun 28 16:21:25 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.array-intersect"> <refnamediv> <refname>array_intersect</refname> @@ -25,14 +25,17 @@ <title><function>array_intersect</function> Beispiel</title> <programlisting role="php"> <![CDATA[ +<?php $array1 = array ("a" => "grün", "rot", "blau"); $array2 = array ("b" => "grün", "gelb", "rot"); $result = array_intersect ($array1, $array2); +?> ]]> </programlisting> <para> Danach enthält <varname>$result</varname> - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Array ( @@ -40,8 +43,7 @@ [0] => rot ) ]]> - </screen> - </para> + </screen> </example> </para> <note> Index: phpdoc-de/reference/array/functions/array-key-exists.xml diff -u phpdoc-de/reference/array/functions/array-key-exists.xml:1.5 phpdoc-de/reference/array/functions/array-key-exists.xml:1.6 --- phpdoc-de/reference/array/functions/array-key-exists.xml:1.5 Sat Oct 5 18:47:19 2002 +++ phpdoc-de/reference/array/functions/array-key-exists.xml Sat Jun 28 16:21:25 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.6 Maintainer: tom Status: ready --> <refentry id="function.array-key-exists"> <refnamediv> <refname>array_key_exists</refname> @@ -24,10 +24,12 @@ <title><function>array_key_exists</function></title> <programlisting role="php"> <![CDATA[ +<?php $search_array = array("erstes" => 1, "zweites" => 4); if (array_key_exists("erstes", $search_array)) { echo "Das Element 'erstes' ist in dem Array vorhanden"; } +?> ]]> </programlisting> </example> Index: phpdoc-de/reference/array/functions/array-keys.xml diff -u phpdoc-de/reference/array/functions/array-keys.xml:1.4 phpdoc-de/reference/array/functions/array-keys.xml:1.5 --- phpdoc-de/reference/array/functions/array-keys.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/array-keys.xml Sat Jun 28 16:21:25 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-keys"> <refnamediv> <refname>array_keys</refname> @@ -30,19 +30,23 @@ <title><function>array_keys</function></title> <programlisting role="php"> <![CDATA[ +<?php $array = array (0 => 100, "Farbe" => "rot"); print_r(array_keys ($array)); $array = array ("blau", "rot", "grün", "blau", "blau"); print_r(array_keys ($array, "blau")); -$array = array ("Farbe" => array("blau", "rot", "grün"), "Größe" => array("klein", "mittel", "groß")); +$array = array ("Farbe" => array("blau", "rot", "grün"), + "Größe" => array("klein", "mittel", "groß")); print_r(array_keys ($array)); +?> ]]> </programlisting> <para> würde folgendes ausgeben: - <screen> + </para> + <screen> <![CDATA[ Array ( @@ -61,38 +65,12 @@ [1] => Größe ) ]]> - </screen> - </para> + </screen> </example> </para> - <note> - <para> - Diese Funktion wurde in PHP 4 eingeführt, nachstehend finden Sie eine - Implementierung für Benutzer von PHP 3. - <example> - <title> - Implementierung von <function>array_keys</function> für - Benutzer von PHP 3: - </title> - <programlisting role="php"> -<![CDATA[ -function array_keys ($arr, $term="") { - $t = array(); - while (list($k,$v) = each($arr)) { - if ($term && $v != $term) { - continue; - } - $t[] = $k; - } - return $t; -} -]]> - </programlisting> - </example> - </para> - </note> <para> - Siehe auch <function>array_values</function>. + Siehe auch <function>array_values</function> und. + <function>array_key_exists</function>. </para> </refsect1> </refentry> Index: phpdoc-de/reference/array/functions/array-map.xml diff -u phpdoc-de/reference/array/functions/array-map.xml:1.6 phpdoc-de/reference/array/functions/array-map.xml:1.7 --- phpdoc-de/reference/array/functions/array-map.xml:1.6 Fri Feb 7 17:58:46 2003 +++ phpdoc-de/reference/array/functions/array-map.xml Sat Jun 28 16:21:25 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.8 Maintainer: tom Status: ready --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.9 Maintainer: tom Status: ready --> <refentry id="function.array-map"> <refnamediv> <refname>array_map</refname> @@ -42,7 +42,8 @@ </programlisting> <para> Dies speichert in <varname>$b</varname>: - <screen> + </para> + <screen> <![CDATA[ Array ( @@ -53,8 +54,7 @@ [4] => 125 ) ]]> - </screen> - </para> + </screen> </example> </para> <para> @@ -86,7 +86,8 @@ </programlisting> <para> Dies resultiert in: - <screen> + </para> + <screen> <![CDATA[ // Ausgabe von $c Array @@ -128,8 +129,7 @@ ) ]]> - </screen> - </para> + </screen> </example> </para> <para> @@ -163,7 +163,8 @@ </para> <para> Würde folgendes ausgeben: - <screen> + </para> + <screen> <![CDATA[ Array ( @@ -204,8 +205,7 @@ ) ]]> - </screen> - </para> + </screen> <para> Siehe auch <function>array_filter</function>, <function>array_reduce</function> und Index: phpdoc-de/reference/array/functions/array-merge-recursive.xml diff -u phpdoc-de/reference/array/functions/array-merge-recursive.xml:1.4 phpdoc-de/reference/array/functions/array-merge-recursive.xml:1.5 --- phpdoc-de/reference/array/functions/array-merge-recursive.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/array-merge-recursive.xml Sat Jun 28 16:21:25 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-merge-recursive"> <refnamediv> <refname>array_merge_recursive</refname> @@ -34,14 +34,17 @@ <title><function>array_merge_recursive</function></title> <programlisting role="php"> <![CDATA[ +<?php $ar1 = array ("farbe" => array ("favorit" => "rot"), 5); $ar2 = array (10, "farbe" => array ("favorit" => "grün", "blau")); $result = array_merge_recursive ($ar1, $ar2); +?> ]]> </programlisting> <para> The <literal>$result</literal> will be: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Array ( @@ -60,8 +63,7 @@ [1] => 10 ) ]]> - </screen> - </para> + </screen> </example> </para> <para> Index: phpdoc-de/reference/array/functions/array-merge.xml diff -u phpdoc-de/reference/array/functions/array-merge.xml:1.6 phpdoc-de/reference/array/functions/array-merge.xml:1.7 --- phpdoc-de/reference/array/functions/array-merge.xml:1.6 Fri Feb 7 17:58:46 2003 +++ phpdoc-de/reference/array/functions/array-merge.xml Sat Jun 28 16:21:25 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.9 Maintainer: tom Status: ready --> <refentry id="function.array-merge"> <refnamediv> <refname>array_merge</refname> @@ -32,15 +32,18 @@ <title><function>array_merge</function></title> <programlisting role="php"> <![CDATA[ +<?php $array1 = array ("farbe" => "rot", 2, 4); $array2 = array ("a", "b", "farbe" => "grün", "form" => "trapezoid", 4); $result = array_merge ($array1, $array2); print_r($result); +?> ]]> </programlisting> <para> Nun ist <literal>$result</literal>: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Array ( @@ -53,8 +56,7 @@ [4] => 4 ) ]]> - </screen> - </para> + </screen> </example> </para> <para> @@ -62,42 +64,48 @@ <title>Einfaches <function>array_merge</function> Beispiel</title> <programlisting role="php"> <![CDATA[ +<?php $array1 = array(); $array2 = array(1 => "data"); $result = array_merge($array1, $array2); +?> ]]> </programlisting> <para> Vergessen Sie nicht, dass numerische Schlüssel neu numeriert werden! - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Array ( [0] => data ) ]]> - </screen> - </para> + </screen> <para> Wenn Sie die Arrays komplett erhalten und nur eines an das andere anhängen wollen, verwenden Sie den Operator <literal>+</literal>: - <programlisting role="php"> + </para> + <programlisting role="php"> <![CDATA[ +<?php $array1 = array(); $array2 = array(1 => "data"); $result = $array1 + $array2; +?> ]]> - </programlisting> + </programlisting> + <para> Der numerische Schlüssel sowie die Assoziation bleiben erhalten. - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Array ( [1] => data ) ]]> - </screen> - </para> + </screen> </example> </para> <note> Index: phpdoc-de/reference/array/functions/array-multisort.xml diff -u phpdoc-de/reference/array/functions/array-multisort.xml:1.5 phpdoc-de/reference/array/functions/array-multisort.xml:1.6 --- phpdoc-de/reference/array/functions/array-multisort.xml:1.5 Wed Jan 15 15:23:11 2003 +++ phpdoc-de/reference/array/functions/array-multisort.xml Sat Jun 28 16:21:25 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.6 Maintainer: tom Status: ready --> <refentry id="function.array-multisort"> <refnamediv> <refname>array_multisort</refname> @@ -75,9 +75,11 @@ <title>Sortieren mehrerer Arrays</title> <programlisting role="php"> <![CDATA[ +<?php $ar1 = array ("10", 100, 100, "a"); $ar2 = array (1, 3, "2", 1); array_multisort ($ar1, $ar2); +?> ]]> </programlisting> </example> @@ -94,9 +96,11 @@ <title>Sortieren eines mehrdimensionalen Arrays</title> <programlisting role="php"> <![CDATA[ +<?php $ar = array (array ("10", 100, 100, "a"), array (1, 3, "2", 1)); array_multisort ($ar[0], SORT_ASC, SORT_STRING, $ar[1], SORT_NUMERIC, SORT_DESC); +?> ]]> </programlisting> </example> Index: phpdoc-de/reference/array/functions/array-pad.xml diff -u phpdoc-de/reference/array/functions/array-pad.xml:1.4 phpdoc-de/reference/array/functions/array-pad.xml:1.5 --- phpdoc-de/reference/array/functions/array-pad.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/array-pad.xml Sat Jun 28 16:21:25 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-pad"> <refnamediv> <refname>array_pad</refname> @@ -32,6 +32,7 @@ <title><function>array_pad</function></title> <programlisting role="php"> <![CDATA[ +<?php $input = array (12, 10, 9); $result = array_pad ($input, 5, 0); @@ -42,6 +43,7 @@ $result = array_pad ($input, 2, "noop"); // nicht erweitert +?> ]]> </programlisting> </example> Index: phpdoc-de/reference/array/functions/array-pop.xml diff -u phpdoc-de/reference/array/functions/array-pop.xml:1.7 phpdoc-de/reference/array/functions/array-pop.xml:1.8 --- phpdoc-de/reference/array/functions/array-pop.xml:1.7 Fri Feb 7 17:58:46 2003 +++ phpdoc-de/reference/array/functions/array-pop.xml Sat Jun 28 16:21:25 2003 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- EN-Revision: 1.5 Maintainer: tom Status: ready --> +<!-- $Revision: 1.8 $ --> +<!-- EN-Revision: 1.7 Maintainer: tom Status: ready --> <refentry id="function.array-pop"> <refnamediv> <refname>array_pop</refname> @@ -36,7 +36,8 @@ </programlisting> <para> Danach hat <varname>$stack</varname> nur 3 Elemente: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Array ( @@ -45,7 +46,8 @@ [2] => Apfel ) ]]> - </screen> + </screen> + <para> und <literal>Himbeere</literal> wird <varname>$fruit</varname> zugewiesen. </para> Index: phpdoc-de/reference/array/functions/array-push.xml diff -u phpdoc-de/reference/array/functions/array-push.xml:1.5 phpdoc-de/reference/array/functions/array-push.xml:1.6 --- phpdoc-de/reference/array/functions/array-push.xml:1.5 Fri Feb 7 17:58:46 2003 +++ phpdoc-de/reference/array/functions/array-push.xml Sat Jun 28 16:21:25 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-push"> <refnamediv> <refname>array_push</refname> @@ -25,7 +25,9 @@ angefügten Variablen erhöht. Dies hat den selben Effekt wie: <programlisting role="php"> <![CDATA[ +<?php $array[] = $var; +?> ]]> </programlisting> für jede Variable <parameter>var</parameter> wiederholt. @@ -38,15 +40,18 @@ <title><function>array_push</function></title> <programlisting role="php"> <![CDATA[ +<?php $stack = array ("Orange", "Banane"); array_push ($stack, "Apfel", "Himbeere"); print_r($stack); +?> ]]> </programlisting> <para> Danach enthält <varname>$stack</varname> die folgenden Elemente: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Array ( @@ -56,8 +61,7 @@ [3] => Himbeere ) ]]> - </screen> - </para> + </screen> </example> </para> <para> Index: phpdoc-de/reference/array/functions/array-rand.xml diff -u phpdoc-de/reference/array/functions/array-rand.xml:1.4 phpdoc-de/reference/array/functions/array-rand.xml:1.5 --- phpdoc-de/reference/array/functions/array-rand.xml:1.4 Fri May 31 13:47:06 2002 +++ phpdoc-de/reference/array/functions/array-rand.xml Sat Jun 28 16:21:25 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-rand"> <refnamediv> <refname>array_rand</refname> @@ -32,20 +32,21 @@ zufällige Schlüssel und auch Werte aus dem Array auswählen können. </para> - <para> - Vergessen Sie bitte nicht, mittels <function>srand</function> den - Startwert für den Zufallsgenerator festzulegen. - </para> + + &note.randomseed; + <para> <example> <title><function>array_rand</function></title> <programlisting role="php"> <![CDATA[ +<?php srand ((float) microtime() * 10000000); $input = array ("Neo", "Morpheus", "Trinity", "Cypher", "Tank"); $rand_keys = array_rand ($input, 2); print $input[$rand_keys[0]]."\n"; print $input[$rand_keys[1]]."\n"; +?> ]]> </programlisting> </example> Index: phpdoc-de/reference/array/functions/array-reduce.xml diff -u phpdoc-de/reference/array/functions/array-reduce.xml:1.5 phpdoc-de/reference/array/functions/array-reduce.xml:1.6 --- phpdoc-de/reference/array/functions/array-reduce.xml:1.5 Sat Jan 11 10:19:37 2003 +++ phpdoc-de/reference/array/functions/array-reduce.xml Sat Jun 28 16:21:25 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.6 Maintainer: tom Status: ready --> <refentry id="function.array-reduce"> <refnamediv> <refname>array_reduce</refname> @@ -30,6 +30,7 @@ <title><function>array_reduce</function></title> <programlisting role="php"> <![CDATA[ +<?php function rsum($v, $w) { $v += $w; return $v; @@ -45,6 +46,7 @@ $b = array_reduce($a, "rsum"); $c = array_reduce($a, "rmul", 10); $d = array_reduce($x, "rsum", 1); +?> ]]> </programlisting> </example>
« previous php.doc.de (#814) next »