Files
doc-fr/reference/array/functions/array-combine.xml
Jean-Sébastien Goupil dcbd76b0cc sync with EN
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@222717 c90b9560-bf6c-de11-be94-00142212c4b1
2006-11-03 12:03:58 +00:00

83 lines
2.0 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.12 $ -->
<!-- EN-Revision: 1.7 Maintainer: didou Status: ready -->
<!-- Reviewed: no -->
<refentry id="function.array-combine">
<refnamediv>
<refname>array_combine</refname>
<refpurpose>Crée un tableau à partir de deux autres tableaux</refpurpose>
</refnamediv>
<refsect1>
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>array_combine</methodname>
<methodparam><type>array</type><parameter>keys</parameter></methodparam>
<methodparam><type>array</type><parameter>values</parameter></methodparam>
</methodsynopsis>
<para>
<function>array_combine</function> retourne un <type>array</type>,
dont les clés sont les valeurs de <parameter>keys</parameter>, et les
valeurs sont les valeurs de <parameter>values</parameter>.
</para>
<para>
<function>array_combine</function> retourne &false; si le nombre
d'éléments de chaque tableau n'est pas le même, ou si les tableaux
sont vides.
</para>
<para>
<example>
<title>Exemple avec <function>array_combine</function></title>
<programlisting role="php">
<![CDATA[
<?php
$a = array('vert','rouge','jaune');
$b = array('avocat','pomme','banane');
$c = array_combine($a, $b);
print_r($c);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
Array
(
[vert] => avocat
[rouge] => pomme
[jaune] => banane
)
]]>
</screen>
</example>
</para>
<para>
Voir aussi
<function>array_merge</function>,
<function>array_walk</function> et
<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
-->