2 次元配列のマージの問題
Array ( [108-3752685-0517825] => Array ( [0] => 6300-00 ) [107-5010391-7170621] => Array ( [0] => 0054-00 ) [105-5621773-8281824] => 配列 ( [0] => 0049-00 ) )
配列 ( [2200320000123] => 配列 ( [0] = > 0054-00 ) [2200320123501] => 配列 ( [0] => 0049-00 ) [220032012395200] => 配列 ( [0] => 0049-00 )
([ 108-3752685-0517825] => 配列 ( [0] => 6300-00 ) [107-5010391-7170621] => 配列 ( [0] => 0054-00 ) [105-5621773- 828 1824] => 配列 ( [0] => 0049-00 ) [0] => 配列 ( [0] => 0054-00 ) 0049-00 ) [2] => Array ( [0] => 0049-00 ) )
array_merge でマージした後、2 番目の配列のキー名が消えてしまいました。私の使い方は間違っていますか? ?
------解決策のアイデア----------------------
そうではありませんか?
$a = array (<br /> '108-3752685-0517825' => <br /> array (<br /> 0 => '6300-00',<br /> ),<br /> '107-5010391-7170621' => <br /> array (<br /> 0 => '0054-00',<br /> ),<br /> '105-5621773-8281824' => <br /> array (<br /> 0 => '0049-00',<br /> ),<br />);<br />$b = array (<br /> '2200320000123' => <br /> array (<br /> 0 => '0054-00',<br /> ),<br /> '2200320123501' => <br /> array (<br /> 0 => '0049-00',<br /> ),<br /> '220032012395200' => <br /> array (<br /> 0 => '0049-00',<br /> ),<br />);<br />$t = array_merge($a, $b);<br />print_r($t);
Array<br />(<br /> [108-3752685-0517825] => Array<br /> (<br /> [0] => 6300-00<br /> )<br /><br /> [107-5010391-7170621] => Array<br /> (<br /> [0] => 0054-00<br /> )<br /><br /> [105-5621773-8281824] => Array<br /> (<br /> [0] => 0049-00<br /> )<br /><br /> [2200320000123] => Array<br /> (<br /> [0] => 0054-00<br /> )<br /><br /> [2200320123501] => Array<br /> (<br /> [0] => 0049-00<br /> )<br /><br /> [220032012395200] => Array<br /> (<br /> [0] => 0049-00<br /> )<br /><br />)<br /><br />