php-Arrays函数-array_merge_recursive-递归地合并一个或多个数组
array_merge_recursive() 递归地合并一个或多个数组
【功能】
该函数将一个或多个数组的单元合并起来,一个数组中的值附加在前一个数组的后面。
返回作为结果的数组。如果输入的数组中有相同的字符串键名,则这些值会被合并到一个
数组中,这将递归下去,因此如果一个值本身是一个数组,则该函数将按照相应的条目把它合并
为另一个数组。然而,如果数组具体相同的数组键名,后一个值将不会覆盖原来的值,而
是附加到后面。
【使用范围】
php4>4.0.1、php5.
【使用】
array array_merge_recursive( array array1[,array...] )
arrayn/必需/即将用来合并的数组
【示例】
[php]
$arr1 = array("color"=>array("favorite"=>"red"),5);
$arr2 = array(10,"color"=>array("favorite"=>"green","blue"));
var_dump(array_merge_recursive($arr1,$arr2));
/*
array(3) {
["color"]=>
array(2) {
["favorite"]=>
array(2) {
[0]=>
string(3) "red"
[1]=>
string(5) "green"
}
[0]=>
string(4) "blue"
}
[0]=>
int(5)
[1]=>
int(10)
}
*/
摘自 zuodefeng的笔记

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Chinese version
Chinese version, very easy to use

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function
