array_intersect a variable amount of arrays

前端 未结 4 458
陌清茗
陌清茗 2021-01-13 17:30

I am creating a faceted search, and I\'m am trying to use array_intersect to compare the arrays and find the inputs that match.

The problem is that I wi

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-13 18:03

    First of all, turn those arrays into an array of arrays. Then you can use array_reduce combined with array_intersect to reduce a variable amount of arrays down to one.

提交回复
热议问题