|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-11-12 06:33 UTC] sniper@php.net
[2002-11-12 07:16 UTC] mailfrom-bugs dot php dot net at kopka dot net
[2002-11-12 07:22 UTC] sniper@php.net
[2002-11-15 07:38 UTC] moriyoshi@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 08:00:01 2025 UTC |
Similar to #14990 (exept that the demo code there runs fine) and the first source array gets mangled. Example ========= <pre><? $a = array( 'a1' => 1, 'a2' => array( 1, 2, 3 ), 'a3' => array( 'a' => array( 10, 20, 30 ), 'b' => 'b' ) ); $b = array( 'a1' => 2, 'a2' => array( 3, 4, 5 ), 'a3' => array( 'c' => 'cc', 'a' => array( 10, 40 ) ) ); $c['result'] = array_merge_recursive( $a, $b ); $c['a'] = $a; $c['b'] = $b; print_r( $c ); ?> Example Output ================ Array ( [result] => Array ( [a1] => Array ( [0] => 1 [1] => 2 ) [a2] => Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 3 [4] => 4 [5] => 5 ) [a3] => Array ( [a] => Array ( [0] => 10 [1] => 20 [2] => 30 [3] => 10 [4] => 40 ) [b] => b [c] => cc ) ) [a] => Array ( [a1] => 1 [a2] => Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 3 [4] => 4 [5] => 5 ) [a3] => Array ( [a] => Array ( [0] => 10 [1] => 20 [2] => 30 [3] => 10 [4] => 40 ) [b] => b [c] => cc ) ) [b] => Array ( [a1] => 2 [a2] => Array ( [0] => 3 [1] => 4 [2] => 5 ) [a3] => Array ( [c] => cc [a] => Array ( [0] => 10 [1] => 40 ) ) ) )