mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-24 07:02:09 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/pt_BR/trunk@248653 c90b9560-bf6c-de11-be94-00142212c4b1
115 lines
2.7 KiB
XML
115 lines
2.7 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- EN-Revision: 1.14 Maintainer: felipe Status: ready --><!-- CREDITS: lucasr -->
|
|
<refentry xml:id="function.array-pop" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>array_pop</refname>
|
|
<refpurpose>Retira um elemento do final do array</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>mixed</type><methodname>array_pop</methodname>
|
|
<methodparam><type>array</type><parameter role="reference">array</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>array_pop</function> retira e retorna o último
|
|
elemento de <parameter>array</parameter>, diminuindo
|
|
<parameter>array</parameter> em um elemento.
|
|
Se <parameter>array</parameter> estiver vazio (ou se não for um array),
|
|
o valor &null; é retornado.
|
|
</para>
|
|
&array.resetspointer;
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>array</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
O array para obter os valores.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retorna o último valor de <parameter>array</parameter>.
|
|
Se <parameter>array</parameter> é vazio (ou ele não é um array),
|
|
&null; será retornado.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemplo da <function>array_pop</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$cesta = array("laranja", "banana", "melancia", "morango");
|
|
$fruta = array_pop($cesta);
|
|
print_r($cesta);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
Depois disso, <varname>$cesta</varname> terá 3 elementos:
|
|
</para>
|
|
<screen role="php">
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[0] => laranja
|
|
[1] => banana
|
|
[2] => melancia
|
|
)
|
|
]]>
|
|
</screen>
|
|
<para>
|
|
e <literal>morango</literal> será passado para
|
|
<varname>$fruta</varname>.
|
|
</para>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
Veja também <function>array_push</function>,
|
|
<function>array_shift</function>, e
|
|
<function>array_unshift</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|