mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 16:32:13 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@334774 c90b9560-bf6c-de11-be94-00142212c4b1
112 lines
2.6 KiB
XML
112 lines
2.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 14af302c9c0e561fa6f9cdd956268758ba9a89c5 Maintainer: andresdzphp Status: ready -->
|
|
<!-- Reviewed: no Maintainer: andresdzphp -->
|
|
|
|
<refentry xml:id="arrayobject.exchangearray" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>ArrayObject::exchangeArray</refname>
|
|
<refpurpose>Intercambia el array por otro</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>array</type><methodname>ArrayObject::exchangeArray</methodname>
|
|
<methodparam><type>mixed</type><parameter>input</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Intercambiar el <type>array</type> actual con otro <type>array</type> u <type>objeto</type>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>input</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El nuevo <type>array</type> u <type>objeto</type> a ser intercambiado con el array actual.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve el <type>array</type> antiguo.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>ArrayObject::exchangeArray</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Array de frutas
|
|
$fruits = array("limones" => 1, "naranjas" => 4, "bananas" => 5, "manzanas" => 10);
|
|
// Array de lugares en Europa
|
|
$locations = array('Amsterdam', 'Paris', 'London');
|
|
|
|
$fruitsArrayObject = new ArrayObject($fruits);
|
|
|
|
// Now exchange fruits for locations
|
|
$old = $fruitsArrayObject->exchangeArray($locations);
|
|
print_r($old);
|
|
print_r($fruitsArrayObject);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[limones] => 1
|
|
[naranjas] => 4
|
|
[bananas] => 5
|
|
[manzanas] => 10
|
|
)
|
|
ArrayObject Object
|
|
(
|
|
[0] => Amsterdam
|
|
[1] => Paris
|
|
[2] => London
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</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
|
|
-->
|
|
|