tags:

views:

49

answers:

0

Possible Duplicate:
PHP - Merge duplicate array keys in a multidimensional array

I have have something similar to this, and Arrays go on for over 100 elements.

 Array
 ( [0] => Array ([id] => 16 
         [data] => Array
                 (
                    [title] => Array
                        (
                            [label] => Title
                            [raw] => Product green
                            [value] => Product green
                        )

                    [image] => Array
                        (
                          [label] => Image
                          [files] => Array
                                (
                                    [0] => mydirectory/product-pink.jpg
                                )
                 )

                    [productfamily] => Array
                        (
                            [label] => Product Family
                            [raw] => 103
                            [value] => Product 01
                        )

                )

        )

    [1] => Array
         (
            [id] => 17
            [data] => Array
                (
                    [title] => Array
                        (
                            [label] => Title
                            [raw] => Product green
                            [value] => Product green
                        )

                    [image] => Array
                        (
                            [label] => Image
                            [files] => Array
                                (
                                    [0] => mydirectory/product-green.jpg
                                )
                )

                    [productfamily] => Array
                        (
                            [label] => Product Family
                            [raw] => 103
                            [value] => Product 01
                        )

                )

        )

now i would like to "group" only the arrays with the same [productfamily] so i can output the different pictures into a same group. What method would you recommand me to use? Some code hints would be greatly appreciated.