1
0
mirror of https://github.com/php/doc-ja.git synced 2026-03-24 15:12:22 +01:00
Files
archived-doc-ja/reference/array/functions/array-combine.xml
TAKAGI Masahiro cdfe3e4bbb sync with en.
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@222583 c90b9560-bf6c-de11-be94-00142212c4b1
2006-10-31 13:44:12 +00:00

83 lines
2.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.4 $ -->
<!-- EN-Revision: 1.7 Maintainer: hirokawa Status: ready -->
<!-- CREDITS: shimooka -->
<refentry id="function.array-combine">
<refnamediv>
<refname>array_combine</refname>
<refpurpose>
一方の配列をキーとして、もう一方の配列を値として、ひとつの配列を生成する
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<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>
<parameter>keys</parameter> 配列の値をキーとして、また
<parameter>values</parameter> 配列の値を対応する値として生成した
<type>配列</type>を返します。
</para>
<para>
互いの配列の要素の数が合致しない場合や空の配列である場合に
&false; を返します。
</para>
<para>
<example>
<title><function>array_combine</function>の簡単な例</title>
<programlisting role="php">
<![CDATA[
<?php
$a = array('green', 'red', 'yellow');
$b = array('avocado', 'apple', 'banana');
$c = array_combine($a, $b);
print_r($c);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
Array
(
[green] => avocado
[red] => apple
[yellow] => banana
)
]]>
</screen>
</example>
</para>
<para>
<function>array_merge</function>
<function>array_walk</function> および
<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
-->