1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-24 15:32:36 +01:00
Files
archived-doc-es/reference/array/functions/array-combine.xml
2003-12-16 03:10:11 +00:00

85 lines
2.2 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready -->
<refentry id="function.array-combine">
<refnamediv>
<refname>array_combine</refname>
<refpurpose>
Crea una nueva matriz, usando una matriz para las claves y otra
para sus valores
</refpurpose>
</refnamediv>
<refsect1>
<title>Descripci&oacute;n</title>
<methodsynopsis>
<type>array</type><methodname>array_combine</methodname>
<methodparam><type>array</type><parameter>claves</parameter></methodparam>
<methodparam><type>array</type><parameter>valores</parameter></methodparam>
</methodsynopsis>
<para>
Devuelve un <type>array</type> usando los valores de la matriz
<parameter>claves</parameter> como claves, y los valores de la matriz
<parameter>valores</parameter> como los valores correspondientes.
</para>
<para>
Devuelve &false; si el n&uacute;mero de elementos de cada matriz no es
equivalente o si las matrices est&aacute;n vac&iacute;as.
</para>
<para>
<example>
<title>Un ejemplo simple de <function>array_combine</function></title>
<programlisting role="php">
<![CDATA[
<?php
$a = array('verde', 'rojo', 'amarillo');
$b = array('aguacate', 'manzana', 'banano');
$c = array_combine($a, $b);
print_r($c);
?>
]]>
</programlisting>
<para>
Genera la salida:
</para>
<screen>
<![CDATA[
Array
(
[verde] => aguacate
[rojo] => manzana
[amarillo] => banano
)
]]>
</screen>
</example>
</para>
<para>
Vea tambi&eacute;n <function>array_merge</function>,
<function>array_walk</function>, y
<function>array_values</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
-->