-4
[0] => Array ( [id] => 9 [order_address_id] => 9 [created] => 2015-12-17 12:24:20 [order_status] => dispatched [total_discount] => [total_shipping_charge] => 60 [s_state] => NY [b_state] => NY [order_id] => 9 [p_name] => Product 1 [qty] => 1 [price] => 475 ) [1] => Array ( [id] => 9 [order_address_id] => 9 [created] => 2015-12-17 12:24:20 [order_status] => dispatched [total_discount] => [total_shipping_charge] => 60 [s_state] => MA [b_state] => MA [order_id] => 9 [p_name] => Product 2 [qty] => 1 [price] => 349 )
我想查找是否重複具有相同ID的數組,然後必須從具有相同ID的第二個和後續數組中刪除total_shipping_charge。我怎樣才能在PHP中做到這一點?在PHP數組中發現重複值
向我們展示您試用過的產品 – Epodax
您可能想對PHP中的foreach循環做一些研究。 – Martijn
查看'array_reduce(array $ array,callable $ callback)'和'function(mixed $ carry,mixed $ item)use(&$ myGlobal){}'的函數來獲取回調函數 – JustOnUnderMillions