2014-09-26 69 views
0

我有2個數組。我想結合他們。array_merge結果到不同的鍵

陣列1:

Array 
(
[100] => 
[50] => 
[CREDIT] => 14.31 
[CHEQUE] => 
) 

陣列2:

Array 
(
[id] => 491 
[ce_unique_id] => CE144915960926-21 
[company_id] => 1 
) 

我與array_merge()合併後,他們得到這個結果:

Array 
(
--->[0] => 
--->[1] => 
[CREDIT] => 14.31 
[CHEQUE] => 
[id] => 491 
[ce_unique_id] => CE144915960926-21 
[company_id] => 1 
) 

而且我的e xpected results is:

Array 
(
--->[100] => 
--->[50] => 
[CREDIT] => 14.31 
[CHEQUE] => 
[id] => 491 
[ce_unique_id] => CE144915960926-21 
[company_id] => 1 
) 

爲什麼數字鍵在合併2個數組後變了?

回答