mirror of
https://github.com/php/doc-es.git
synced 2026-04-28 01:23:14 +02:00
b27fa497e2
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@288876 c90b9560-bf6c-de11-be94-00142212c4b1
135 lines
3.3 KiB
XML
135 lines
3.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: af4410a7e15898c3dbe83d6ea38246745ed9c6fb Maintainer: lboshell Status: ready -->
|
|
<refentry xml:id="function.array-combine" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>array_combine</refname>
|
|
<refpurpose>Crea una nueva matriz, usando una matriz para las claves y
|
|
otra para sus valores</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<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>
|
|
Crea 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>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
<term><parameter>claves</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Matriz de las claves a usar. Cualquier valor inválido para la clave
|
|
será convertido a <type>string</type>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
<term><parameter>valores</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Matriz de valores a usar
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve el valor tipo <type>array</type> combinado, &false; si el número
|
|
de elementos de cada matriz no es equivalente o si las matrices están
|
|
vacías.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
Genera un <constant>E_WARNING</constant> si <parameter>claves</parameter>
|
|
y <parameter>valores</parameter> son matrices vacías, o el número de
|
|
elementos no coincide.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<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>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[verde] => aguacate
|
|
[rojo] => manzana
|
|
[amarillo] => banano
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>array_merge</function></member>
|
|
<member><function>array_walk</function></member>
|
|
<member><function>array_values</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
|
|
-->
|