mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-27 10:22:07 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@224763 c90b9560-bf6c-de11-be94-00142212c4b1
57 lines
1.4 KiB
XML
57 lines
1.4 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.1 $ -->
|
|
<!-- EN-Revision: 1.2 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry id="function.array-fill-keys">
|
|
<refnamediv>
|
|
<refname>array_fill_keys</refname>
|
|
<refpurpose>Remplit un tableau avec des valeurs, en spécifiant les clés</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>array_fill_keys</methodname>
|
|
<methodparam><type>array</type><parameter>keys</parameter></methodparam>
|
|
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>array_fill_keys</function> remplit un tableau avec la valeur du
|
|
paramètre <parameter>value</parameter>, et en utilisant les valeurs du tableau
|
|
<parameter>keys</parameter> comme clés..
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>array_fill_keys</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$keys = array('foo', 5, 10, 'bar');
|
|
$a = array_fill_keys($keys, 'banane');
|
|
print_r($a);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
<varname>$a</varname> vaut maintenant :
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[foo] => banane
|
|
[5] => banane
|
|
[10] => banane
|
|
[bar] => banane
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
Voir aussi
|
|
<function>array_fill</function> et
|
|
<function>array_combine</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|