Jump to content

Sorting the internal nodes of a multi dimensonial array???


cooldude832

Recommended Posts

I have an array that gets a bunch of data that is like

(

    [0] => Array

        (

            [items] => Array

                (

                    [0] => Array

                        (

                            [Description] => SWEETHEART ROSE BOUQUET - 18 STEMS W/VASE

                        )

 

                )

 

            [shiping_Address] =>  *****************

            [subtotal] => $29.99

            [shipping_cost] => $10.99

            [Tax] => $0.00

            [Total] => $40.98

            [buyer_Address] =>  **************************

            [Order_number] => W00442101216543

            [Purchase_date] => 11/29/2007

            [Purchaser] => ***********

            [Merchant] => flowers1800

        )

 

    [1] => Array

        (

            [Purchase_date] => 11/26/2007

            [Order_number] => 4071126192538514

            [Total] => $36.48

            [subtotal] => $24.99

            [Tax] => $1.50

            [shipping_cost] => $9.99

            [shipping_method] => USA Overnight

            [items] => Array

                (

                    [0] => Array

                        (

                            [Description] => Resident Evil 4 Wii Edition- - $5 Off!

                            [Qty] => 1

                            [Cost] => $24.99

                        )

 

                )

 

            [Purchaser] => **************

            [Merchant] => Gamestop

        )

 

 

I want to sort each of the emails so the fields are consistent for view purposes, any ideas???

 

You didn't really show at least a second set of data. Anyway, look into the user defined sort functions. Examples in the manual, and search these forums for other examples.

 

http://us2.php.net/manual/en/function.usort.php

 

http://us2.php.net/manual/en/function.uasort.php

 

http://us2.php.net/manual/en/function.uksort.php

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.