Intersect unknown number of arrays in PHP

后端 未结 5 454
猫巷女王i
猫巷女王i 2021-01-11 09:30

I\'m trying to intersect an arbitrary number of PHP arrays, the count of which depends on a user provided parameter, each of which can have any number of elements.

F

5条回答
  •  不思量自难忘°
    2021-01-11 10:13

    Use the splat operator (...) as in: array_intersect(...$arrayOfArrays) or interchangeably call_user_func_array.

    It's in the code in this tutorial: https://www.youtube.com/watch?v=AMlvtgT3t4E

提交回复
热议问题