- var_dump: documentation ( source)
- array_replace_recursive: documentation ( source)
<?php
$array1 = array(
'group 1' => array(
'test 1',
'test 2',
'test 3'
)
);
$array2 = array(
'group 1' => array(
'test 1',
'test 4'
),
'group 2' => array(
'test2 1',
'test2 2',
'test 4'
)
);
$merged = array_replace_recursive($array1, $array2);
var_dump($merged);