mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-23 22:52:12 +01:00
* Remoção massificada de espaços finais * sync ws * sync ws * sync ws * sync ws * sync ws * sync ws * sync ws * sync ws * sync ws * sync ws * sync ws * sync ws * sync ws * sync ws * sync ws --------- Co-authored-by: André L F S Bacci <ae@php.net> Co-authored-by: Leonardo Lara Rodrigues <leonardo.lara.rodrigues@gmail.com>
139 lines
3.1 KiB
XML
139 lines
3.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- EN-Revision: b8758b0605e80c4e3610137b7502a6abeea5c69b Maintainer: ae Status: ready --><!-- CREDITS: lucasr,ae,lhsazevedo -->
|
|
<refentry xml:id="function.array-reverse" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>array_reverse</refname>
|
|
<refpurpose>Retorna um array com os elementos na ordem inversa</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>array_reverse</methodname>
|
|
<methodparam><type>array</type><parameter>array</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>preserve_keys</parameter><initializer>&false;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Recebe como entrada <parameter>array</parameter> e retorna um novo array com a
|
|
ordem dos elementos invertida.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>array</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
O array de entrada.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>preserve_keys</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Se definido para &true; as chaves serão preservadas.
|
|
Chaves não numéricas não são afetadas por essa opção, e são sempre preservadas.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retorna o array invertido.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>array_reverse</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$input = array("php", 4.0, array("green", "red"));
|
|
$reversed = array_reverse($input);
|
|
$preserved = array_reverse($input, true);
|
|
|
|
print_r($input);
|
|
print_r($reversed);
|
|
print_r($preserved);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen role="php">
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[0] => php
|
|
[1] => 4
|
|
[2] => Array
|
|
(
|
|
[0] => green
|
|
[1] => red
|
|
)
|
|
|
|
)
|
|
Array
|
|
(
|
|
[0] => Array
|
|
(
|
|
[0] => green
|
|
[1] => red
|
|
)
|
|
|
|
[1] => 4
|
|
[2] => php
|
|
)
|
|
Array
|
|
(
|
|
[2] => Array
|
|
(
|
|
[0] => green
|
|
[1] => red
|
|
)
|
|
|
|
[1] => 4
|
|
[0] => php
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>array_flip</function></member>
|
|
</simplelist>
|
|
</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:"~/.phpdoc/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
|
|
-->
|