duanduo0520
duanduo0520
2016-06-11 15:01

过滤具有多个值的多维数组

  • filter
  • php
  • arrays

I have three multidimensional arrays. I want to filter out values in the first array that match two values in the other two arrays.

Array 1 $a[] contains location $a[LOC], quantity $a[QTY] and last activity date $a[DATE].


Array 2 $b[] contains all locations and their last activity date


Array 3 $c[] contains all locations and their current quantity

I need to remove from array $a the locations that appear in array $b which have an activity date bigger than that in array $a (for the same location) and remove from array $a the locations with quantities not matching the same location in array $c.

I have tried combinations of foreach loops with array_intersects but cant seem to get anywhere near what I need.

Any help would be greatly appreciated.

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐