1
我有ARRAY1這樣的:PHP - 相交multidemsional陣列與一個相同的值
Array
(
[0] => Array
(
[0] => test
[1] => 123
)
[1] => Array
(
[0] => testx
[1] => 456
)
)
和ARRAY2這樣的:
Array
(
[0] => Array
(
[0] => test
[1] => somenumber
)
[1] => Array
(
[0] => title
[1] => sometitle
)
[2] => Array
(
[0] => testx
[1] => othernumber
)
)
我需要這樣的輸出:
Array
(
[0] => Array
(
[0] => test
[1] => 123
[2] => somenumber
)
[1] => Array
(
[0] => testx
[1] => 456
[1] => othernumber
)
)
所以我只需要比較每個數組的[0]鍵的值。我曾嘗試與array_intersect和array_diff組合,但我無法讓它工作。任何人都可以向我指出一些方向,做這件事的適當的功能/方法是什麼?
它的工作。謝謝! – codexy