recurse( $array, $array1 )
Description Description
Source Source
File: includes/compat.php
function recurse( $array, $array1 ) { foreach ( $array1 as $key => $value ) { // create new key in $array, if it is empty or not an array if ( ! isset( $array[ $key ] ) || ( isset( $array[ $key ] ) && ! is_array( $array[ $key ] ) ) ) { $array[ $key ] = array(); } // overwrite the value in the base array if ( is_array( $value ) ) { $value = recurse( $array[ $key ], $value ); } $array[ $key ] = $value; } return $array; }
Expand full source code Collapse full source code View on Trac