$ Aarray (& #39; 01 & #39; & gt; array (& #39; count & #39; & gt; 1, & #39; amount & #39; & gt; 100, & #39; cesgu & #39; & gt; 33), & #39; 02 & #39; & gt; array (& #39; count & #39; & gt; 2, & #39; amount & #39; & gt; 200), & #39; 03 & #39; & gt; array (& #39; count & #39; & gt; 3, & #39; amount & #39; & reference array merging php array merging
$ A = array ('01 '=> array ('count' => 1, 'amount' => 100, 'cesgu '=> 33 ),
'02' => array ('count' => 2, 'amount' => 200 ),
'03 '=> array ('count' => 3, 'amount' => 250 ));
$ B = array ('01 '=> array ('count' => 4, 'amount' => 300 ),
'02' => array ('count' => 5, 'amount' => 400 ));
Take $ a as a reference
Output Array ([01] => Array ([count] => 5 [amount] => 400 [cesgu] => 33) [02] => Array ([count] => 7 [amount] => 600)
[03] => Array ([count] => 3 [amount] => 250 ))
If $ B is used as the reference
Output Array ([01] => Array ([count] => 5 [amount] => 400 [cesgu] => 33) [02] => Array ([count] => 7 [amount] => 600)
Ask everyone,