cvs: phpdoc-hu /reference/array/functions array-push.xml

From: Date: Thu, 05 Aug 2004 21:39:43 +0000
Subject: cvs: phpdoc-hu /reference/array/functions array-push.xml
Groups: php.doc.hu 
Request: Send a blank email to doc-hu+get-888@lists.php.net to get a copy of this message
cece Thu Aug 5 17:39:43 2004 EDT Modified files: /phpdoc-hu/reference/array/functions array-push.xml Log: sync http://cvs.php.net/diff.php/phpdoc-hu/reference/array/functions/array-push.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-hu/reference/array/functions/array-push.xml diff -u phpdoc-hu/reference/array/functions/array-push.xml:1.3 phpdoc-hu/reference/array/functions/array-push.xml:1.4 --- phpdoc-hu/reference/array/functions/array-push.xml:1.3 Wed Aug 14 12:56:19 2002 +++ phpdoc-hu/reference/array/functions/array-push.xml Thu Aug 5 17:39:43 2004 @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="iso-8859-2"?> <!-- splitted from ./hu/functions/array.xml, last change in rev 1.3 --> <!-- last change to 'array-push' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.4 Maintainer: gerzson Status: ready --> +<!-- EN-Revision: 1.10 Maintainer: cece Status: ready --> +<!-- CREDITS: gerzson --> <!-- OLD-Revision: 1.173/EN.1.2 --> <refentry id="function.array-push"> <refnamediv> @@ -14,7 +15,7 @@ <title>Leírás</title> <methodsynopsis> <type>int</type><methodname>array_push</methodname> - <methodparam><type>array</type><parameter>array</parameter></methodparam> + <methodparam><type>array</type><parameter>&amp;array</parameter></methodparam> <methodparam><type>mixed</type><parameter>var</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>...</parameter></methodparam> </methodsynopsis> @@ -23,10 +24,12 @@ veremként kezeli, és annak a tetejére - a tömb végére - teszi a paraméterként megadott értékeket. Az <parameter>array</parameter> tömb mérete a hozzáfûzött elemek számával fog nõni. Ennek ugyanaz a hatása, - mintha a : + mintha a: <programlisting role="php"> <![CDATA[ +<?php $tomb[] = $var; +?> ]]> </programlisting> kódot ismételnéd meg mindenegyes <parameter>var</parameter> paraméterre. @@ -39,13 +42,17 @@ <title><function>array_push</function> példa</title> <programlisting role="php"> <![CDATA[ -$verem = array ("narancs", "banán"); -array_push ($verem, "alma", "málna"); +<?php +$verem = array("narancs", "banán"); +array_push($verem, "alma", "málna"); +print_r($verem); +?> ]]> </programlisting> <para> E példában a <varname>$verem</varname> tömbnek 4 eleme lesz: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Array ( @@ -55,14 +62,23 @@ [3] => málna ) ]]> - </screen> - </para> + </screen> </example> </para> + <note> + <simpara> + Ha arra akarod használni az <function>array_push</function> + függvényt, hogy a tömb végére tegyél egyetlen elemet, + használd inkább a <literal>$array[] = </literal> módszert, + mivel az itt tárgyalt függvény alkalmazása erre a feladatra + jóval erõforrásigényesebb. + </simpara> + </note> <para> - Lásd még: <function>array_pop</function>, + Lásd még: + <function>array_pop</function>, <function>array_shift</function> és - <function>array_unshift</function>! + <function>array_unshift</function>. </para> </refsect1> </refentry>

« previous php.doc.hu (#888) next »