Documentation by Matt W

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@223029 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jakub Vrana 2006-11-09 08:23:00 +00:00
parent 790d916642
commit ad25f5f4b0

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<refentry id="function.array-fill-keys">
<refnamediv>
<refname>array_fill_keys</refname>
<refpurpose>Fill an array with values, specifying keys</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<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> fills an array with the
value of the <parameter>value</parameter> parameter, using the
values of the <parameter>keys</parameter> array as keys.
</para>
<para>
<example>
<title><function>array_fill_keys</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$keys = array('foo', 5, 10, 'bar');
$a = array_fill_keys($keys, 'banana');
print_r($a);
?>
]]>
</programlisting>
<para>
<varname>$a</varname> now is:
</para>
<screen>
<![CDATA[
Array
(
[foo] => banana
[5] => banana
[10] => banana
[bar] => banana
)
]]>
</screen>
</example>
</para>
<para>
See also <function>array_fill</function> and
<function>array_combine</function>.
</para>
</refsect1>
</refentry>