PHP array_merge_recursive doesn't work as I wish

ntvirus

New Member
So basically I have these two arrays I want to merge...\[code\]array(1) { ["first"]=> array(1) { ["second"]=> array(0) { } } } array(1) { ["second"]=> array(1) { ["third"]=> array(0) { } } }\[/code\]And this is the result I'd like to achieve...\[code\]array(1) { ["first"]=> array(1) { ["second"]=> array(1) { ["third"]=> array(0) { } } } }\[/code\]But using \[code\]$arr = array_merge_recursive($arr1, $arr2)\[/code\] I get this output:\[code\]array(2) { ["first"]=> array(1) { ["second"]=> array(0) { } } ["second"]=> array(1) { ["third"]=> array(0) { } } } \[/code\]From what I understand array_merge_recursive should get me what I want, but apparently doesn't. What would be a solution for my problem?Thanks
 
Back
Top