根據extref
,我應該使用什麼函數來組合array 0
和array 1
。如果值extref
與array 0
和array 1
相同,則該陣列的組合爲真。函數php來組合陣列
Array
([Transaction] => Array
([0] => Array //firts index array
([extref] => WVB4108-10002761
[Denominations] => Array
([Denomination] => Array
([0] => Array
(
[denomvalue] => 0.10
[denomqty] => 5
[denomcount] => 0.50
)
[1] => Array
(
[denomvalue] => 0.50
[denomqty] => 2
[denomcount] => 1.00
)
))))
[1] => Array //second index array
([extref] => WVB4108-10002761
[Denominations] => Array
([Denomination] => Array
(
[denomvalue] => 1.00
[denomqty] => 13
[denomcount] => 13.00
)
))
的結果應該如下: -
Array
([Transaction] => Array
([0] => Array
([extref] => WVB4108-10002761
[Denominations] => Array
([Denomination] => Array
([0] => Array
(
[denomvalue] => 0.10
[denomqty] => 5
[denomcount] => 0.50
)
[1] => Array
(
[denomvalue] => 0.50
[denomqty] => 2
[denomcount] => 1.00
)
[2] => Array
(
[denomvalue] => 1.00
[denomqty] => 13
[denomcount] => 13.00
)
))))
你能顯示結果應該是什麼樣子? – Barmar
'if($ array ['Transaction'] [0] ['extref'] == $ array ['Transaction'] [1] ['extref']){$ result = true; } else {$ result = false; }' – Barmar
Edt這個問題顯示你想要什麼,不要把它放在評論中。 – Barmar