1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-25 16:02:13 +01:00
Files
archived-doc-es/reference/array/functions/array-reverse.xml
Hannes Magnusson ce99262284 Upgrade to DocBook5:
- All id attributes are now xml:id
 - Add docbook namespace to all root elements
 - Replace <ulink /> with <link xlink:href />
 - Minor markup fixes here and there
 - Bump EN-Revision where appropriate


git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@238324 c90b9560-bf6c-de11-be94-00142212c4b1
2007-06-23 13:25:53 +00:00

102 lines
2.7 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- EN-Revision: 1.9 Maintainer: baoengb Status: ready -->
<!-- splitted from ./es/functions/array.xml, last change in rev 1.1 -->
<refentry xml:id="function.array-reverse" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>array_reverse</refname>
<refpurpose>
Devuelve una matriz con los elementos en orden inverso
</refpurpose>
</refnamediv>
<refsect1>
<title>Descripci&oacute;n</title>
<methodsynopsis>
<type>array</type><methodname>array_reverse</methodname>
<methodparam><type>array</type><parameter>matriz</parameter></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>preserva_llaves</parameter></methodparam>
</methodsynopsis>
<para>
<function>array_reverse</function> toma la
<parameter>matriz</parameter> de entrada y devuelve una nueva
matriz con los elementos en orden inverso, se preservan los &iacute;ndices
si <parameter>preserva_llaves</parameter> es &true;
</para>
<para>
<example>
<title>Ejemplo de <function>array_reverse</function></title>
<programlisting role="php">
<![CDATA[
<?php
$entrada = array ("php", 4.0, array ("verde", "rojo"));
$resultado = array_reverse ($entrada);
$resultado_llaves = array_reverse($entrada, true);
?>
]]>
</programlisting>
<para>
Esto hace que ambos <varname>$resultado</varname> y
<varname>$resultado_llaves</varname> tengan los mismos elementos, pero
note la diferencia entre los &iacute;ndices. La salida de
<varname>$resultado</varname> y <varname>$resultado_llaves</varname> ser&aacute;:
</para>
<screen role="php">
<![CDATA[
Array
(
[0] => Array
(
[0] => verde
[1] => rojo
)
[1] => 4
[2] => php
)
Array
(
[2] => Array
(
[0] => verde
[1] => rojo
)
[1] => 4
[0] => php
)
]]>
</screen>
</example>
</para>
<note>
<para>
Esta funci&oacute;n fue a&ntilde;adida en PHP 4.0.3.
</para>
</note>
<para>
Vea tambi&eacute;no <function>array_flip</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
-->