1

Maybe someone can help me find the array intersection of a multidemsional array like this one:

[attributes] => Array
                (
                    [Color] => Array
                        (
                            [0] => Cool White
                            [1] => Warm White
                        )

                    [LED Amount] => Array
                        (
                            [0] => 30 LEDs
                        )

                )

[FILTER] => Array
                (
                    [Color] => Array
                        (
                            [0] => Warm White
                        )

                )

I have tried the following code, but the problem is the multi-dimensional array.

$intersection = array_intersect($arry['FILTER'], $arry['attributes']);

Thanks for your help.

Michiel Pater
  • 22,377
  • 5
  • 43
  • 57
JoeyH
  • 335
  • 2
  • 10

1 Answers1

1

Try this function array_uintersect_assoc

azat
  • 3,545
  • 1
  • 28
  • 30