|
array_replace_recursiveReplaces elements from passed arrays into the first array recursively Description
array array_replace_recursive
( array
$array1
, array $array2
[, array $...
] )
array_replace_recursive replaces the values of
array_replace_recursive is recursive : it will recurse into arrays and apply the same process to the inner value.
When the value in Parameters
Return Values
Returns an array, or Examples
Example #1 array_replace_recursive example
<?phpThe above example will output:
Array
(
[citrus] => Array
(
[0] => pineapple
)
[berries] => Array
(
[0] => blueberry
[1] => raspberry
)
)
Array
(
[citrus] => Array
(
[0] => pineapple
)
[berries] => Array
(
[0] => blueberry
)
)
Example #2 array_replace_recursive and recursive behavior
<?phpThe above example will output:
Array
(
[citrus] => Array
(
[0] => pineapple
)
[berries] => Array
(
[0] => blueberry
[1] => raspberry
)
[others] => litchis
)
See Also
|