mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
790d916642
commit
ad25f5f4b0
1 changed files with 52 additions and 0 deletions
52
reference/array/functions/array-fill-keys.xml
Normal file
52
reference/array/functions/array-fill-keys.xml
Normal 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>
|
Loading…
Reference in a new issue