GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.php.net — PHP: array_replace_recursive - Manual array_replace_recursive(PHP 5 >= 5.3.0, PHP 7, PHP 8) array_replace_recursive — Replaces elements from passed arrays into the first array recursively Description
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 the first array is scalar, it will be replaced by the value in the second array, may it be scalar or array. When the value in the first array and the second array are both arrays, array_replace_recursive() will replace their respective value recursively. Parameters
Return ValuesReturns an array. Examples
Example #1 array_replace_recursive() example The 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 The above example will output: Array
(
[citrus] => Array
(
[0] => pineapple
)
[berries] => Array
(
[0] => blueberry
[1] => raspberry
)
[others] => litchis
)
See Also
+add a note
User Contributed Notes 1 note
Pau Prat Torrella ¶ 6 years ago
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |