Sorting multidimensional array

I have a muli-dimensional array (see below).

I’m trying to use PHP to group matching events. Basically any matchname that is a duplicate (eg. Reds vs Whites) to group them together and group their linksets…

[CODE]Array
(
[matches] => Array
(
[match] => Array
(
[0] => SimpleXMLElement Object
(
[sportname] => Football
[tournamentname] => Crown League
[thetime] => 201308021600
[matchname] => Reds vs Whites
[linkset] => SimpleXMLElement Object
(
[link] => link1.html
[link] => link3.html
)

                    )

                [1] => SimpleXMLElement Object
                    (
                        [sportname] => Football
                        [tournamentname] => Prince League
                        [thetime] => 201308021130
                        [matchname] => Blues vs Yellows
                        [linkset] => SimpleXMLElement Object
                            (
                                [link] => link2.html
                            )

                    )

                [2] => SimpleXMLElement Object
                    (
                        [sportname] => SimpleXMLElement Object
                        [tournamentname] => SimpleXMLElement Object
                        [thetime] => 201308020930
                        [matchname] => Reds vs Whites
                       [linkset] => SimpleXMLElement Object
                            (
                                [link] => link4.html
                            )


                    )
                    
                    
                     )
                    )
                   )[/CODE]

I am trying to end up with
Football: Reds vs Whites (201308021600) - Crown League
Links: link1.html, link3.html, link4.html

Football: Blues vs Yellows (201308021130) - Prince League
Links: link2.html

I’ve been looking at the PHP manual but tearing my hair out trying to get it to output the above. Any ideas would be most welcome.

Thanks

Can you post the code your trying to do the matching with? Maybe someone can point out where you gone wrong, rather then coding it from scratch for you.

Sponsor our Newsletter | Privacy Policy | Terms of Service