1
0
mirror of https://github.com/php/doc-ja.git synced 2026-03-26 08:02:15 +01:00
Files
archived-doc-ja/reference/array/functions/array-combine.xml
Yu Watanabe 9e54a5750a sync to en tree. (added newly)
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@134456 c90b9560-bf6c-de11-be94-00142212c4b1
2003-07-08 15:30:16 +00:00

80 lines
2.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- sync: 1.3 -->
<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);
/* Outputs:
Array
(
[green] => avocado
[red] => apple
[yellow] => banana
)
*/
?>
]]>
</programlisting>
</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
-->