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.

link|improve this question

1  
You could loop through the attributes array. – Michiel Pater Feb 25 '11 at 14:34
1  
Do you have to find the intersection of all attributes or just color? – tandu Feb 25 '11 at 17:41
I have to find the intersection of all attributes – JoeyH Feb 25 '11 at 20:25
feedback

1 Answer

up vote 0 down vote accepted

Try this function array_uintersect_assoc

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.