★ wanayoo — archive 1999 http://fr.php.net/manual/ja/function.array-merge-recursive.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Arrays
Quick Reference
English version of this pageGerman version of this pageJapanese version of this page
Italian version of this pageFrench version of this pageHungarian version of this page
Spanish version of this page is not availableDutch version of this pageBrazilian Portuguese version of this page
Korean version of this pageCzech version of this page
Arrays
* array
* array_count_values
* array_diff
* array_flip
* array_intersect
* array_keys
* array_merge
* array_merge_recursive
* array_multisort
* array_pad
* array_pop
* array_push
* array_rand
* array_reverse
* array_shift
* array_slice
* array_splice
* array_unique
* array_unshift
* array_values
* array_walk
* arsort
* asort
* compact
* count
* current
* each
* end
* extract
* in_array
* array_search
* key
* krsort
* ksort
* list
* natsort
* natcasesort
* next
* pos
* prev
* range
* reset
* rsort
* shuffle
* sizeof
* sort
* uasort
* uksort
* usort

  Thanks to:
 Chek.com
 easyDNS
 VA Linux Systems

  Related sites:
Apache
MySQL
PostgreSQL
Zend Tech.

  Community:
LinuxFund.org
OSDN
Manual: array_merge_recursive
View the source code for this pageSearch the site



Previous page
 array_merge
 Updated
Tue, 27 Feb 2001
array_multisort 
Next page


array_merge_recursive

(PHP 4 >= 4.0.1)

array_merge_recursive -- 二つ以上の配列を再帰的にマージする

説明

array array_merge_recursive (array array1, array array2, [...])

array_merge_recursive()は、 二つ以上の配列の要 素をマージし、前の配列の最後にもう一つの配列の値を追加します。 マージした後の配列を返します。

入力配列が同じ文字列のキーを有している場合、これらのキーの値は配 列に一つのマージされます。これは再帰的に行われます。 このため、値の一つが配列自体を指している場合、この関数は別の配列 の対応するエントリもマージします。しかし、配列が同じ数値キーを有 している場合、後の値は元の値を上書せず、追加されます。

例 1. array_merge_recursive()の例


$ar1 = array("color" => array("favorite" => "red"), 5);
$ar2 = array(10, "color" => array("favorite" => "green", "blue"));
$result = array_merge_recursive($ar1, $ar2);
      

返される配列は、array("color" => array("favorite" => array("red", "green"), "blue"), 5, 10)となります。

array_merge()も参照下さい。


 About Notes


Previous page
 array_merge
 Updated
Tue, 27 Feb 2001
array_multisort 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
France
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.