我有两个数组:
$arr_order:
Array
(
[0] => Array
(
[qty] => 5
[id] => 2
[sku] => Model 2
)
[1] => Array
(
[qty] => 2
[id] => 3
[sku] => Model 1
)
)
$arr_stock:
Array
(
[0] => Array
(
[id] => 2
[qty] => 2
)
[1] => Array
(
[id] => 3
[qty] => 2
)
)
如何使用foreach
循环比较这两个数组?
示例:如果$arr_order[0][qty] =5 > $arr_stock[0][qty] = 2 ...
返回第三个数组:
$arr_stock_available:
Array
(
[0] => Array
(
[id] => 2
[qty] => 2
)
)