title: Intersect unknown number of arrays in PHP
body: <p>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.</p>
  
  <p>For example:
  array1(1, 2, 3, 4, 5)
  array2(2, 4, 6, 8, 9, 23)
  array3(a, b, 3, c, f)
  ...
  arrayN(x1, x2, x3, x4, x5 ... xn)</p>
  
  <p>Since array_intersect takes a list of params, I can't build one array of arrays to intersect and have to work my way around this. I tried this solution: <a href="http://bytes.com/topic/php/answers/13004-array_intersect-unknown-number-arrays" rel="noreferrer">http://bytes.com/topic/php/answers/13004-array_intersect-unknown-number-arrays</a> but this did not work, as an error is reported that array_intersect requires 2 or more params.</p>
  
  <p>Does anyone have any idea how to approach this in a manner as simple as possible?</p>