cvs: phpdoc-pt_BR /reference/array/functions array-shift.xml

From: Date: Thu, 05 Sep 2002 22:30:28 +0000
Subject: cvs: phpdoc-pt_BR /reference/array/functions array-shift.xml
Groups: php.doc.pt-br 
Request: Send a blank email to doc-pt-br+get-127@lists.php.net to get a copy of this message
lucasr Thu Sep 5 18:30:28 2002 EDT Modified files: /phpdoc-pt_BR/reference/array/functions array-shift.xml Log: Making this file up-to-date Index: phpdoc-pt_BR/reference/array/functions/array-shift.xml diff -u phpdoc-pt_BR/reference/array/functions/array-shift.xml:1.2 phpdoc-pt_BR/reference/array/functions/array-shift.xml:1.3 --- phpdoc-pt_BR/reference/array/functions/array-shift.xml:1.2 Sat Apr 20 02:15:59 2002 +++ phpdoc-pt_BR/reference/array/functions/array-shift.xml Thu Sep 5 18:30:28 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.2 Maintainer: lucasr Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: lucasr Status: ready --> <!-- splitted from ./pt_BR/functions/array.xml, last change in rev 1.1 --> <!-- last change to 'array-shift' in en/ tree in rev 1.2 --> <refentry id="function.array-shift"> @@ -10,7 +10,7 @@ </refpurpose> </refnamediv> <refsect1> - <title>Descri&ccedil;&atilde;o</title> + <title>Descrição</title> <methodsynopsis> <type>mixed</type><methodname>array_shift</methodname> <methodparam><type>array</type><parameter>array</parameter></methodparam> @@ -19,27 +19,41 @@ <function>array_shift</function> retira o primeiro elemento de <parameter>array</parameter> e o retorna, diminuindo <parameter>array</parameter> em um elemento e movendo todos os outros - para tr&aacute;s. Se <parameter>array</parameter> estiver vazio (ou se n&atilde;o for - um array), o valor &null; &eacute; retornado. + elementos para trás. Todas as chaves numéricas alteradas para começar a + contar a de 0 (zero), enquanto chaves string permanecerão inalteradas. + Se <parameter>array</parameter> estiver vazio (ou se não for + um array), o valor &null; é retornado. </para> <para> <example> <title>Exemplo de <function>array_shift</function></title> <programlisting role="php"> <![CDATA[ -$args = array ("-v", "-f"); -$opt = array_shift ($args); +$cesta = array ("laranja", "banana", "melancia", "morango"); +$fruta = array_shift ($cesta); ]]> </programlisting> + <para> + O programa acima resultaria em <varname>$stack</varname> tendo 3 + elementos: + <screen role="php"> +<![CDATA[ +Array +( + [0] => banana + [1] => melancia + [2] => morango +) +]]> + </screen> + e <literal>laranja</literal> seria passado para + <varname>$fruta</varname>. + </para> </example> </para> <para> - Isso resultaria em <varname>$args</varname> contendo apenas o elemento - "-f", e <varname>$opt</varname> sendo "-v". - </para> - <para> - Veja tamb&eacute;m <function>array_unshift</function>, - <function>array_push</function>, e + Veja também <function>array_unshift</function>, + <function>array_push</function> e <function>array_pop</function>. </para> </refsect1>

« previous php.doc.pt-br (#127) next »