H
H
Harconnen2014-12-24 20:40:37
PHP
Harconnen, 2014-12-24 20:40:37

How to do Array Convergence?

Hello!
Searched other threads but couldn't find an answer.
I have an array

$arrays = Array (
  '0' => Array (
      '0' => '10',
      '1' => '11',
      '2' => '12'
  ),
  '1' => Array (
      '0' => '10',
      '1' => '13',
      '2' => '12'
  ),
  '2' => Array (
      '0' => '10',
      '1' => '12',
      '2' => '25'
  )
.........................
);

Moreover, the exact number inside the arrays is unknown.
I don't know how to properly apply array_intersect() to get an array with all the same values ​​of all arrays inside the array.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-12-24
Protko @Fesor

Try to figure it out...

$result = call_user_func_array('array_intersect', $arrays);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question