O'Reilly logo

Programming PHP, 3rd Edition by Peter MacIntyre, Kevin Tatroe, Rasmus Lerdorf

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

array_replace_recursive

Synopsis

array array_replace_recursive(array array1, array array2[, ... array arrayN])

Returns an array created by replacing values in array1 with values from the other arrays. Elements in array1 with keys matching in the replacement arrays are replaced with the values of those elements.

If the value in both array1 and a replacement array for a particular key are arrays, those values in those arrays are recursively merged using the same process.

If multiple replacement arrays are provided, they are processed in order. Any elements in array1 whose keys do not match any keys in the replacement arrays are preserved.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required