Jump to content

Sorting array by date/getting earliest date


dc_jt

Recommended Posts

Please see the array below. You will notice there is a date added. What I need to do is work out what the earliest and latest date is from this array, therefore in this example the earliest will be 2009-06-18 09:12:28 and the latest will be [date_added] => 2009-06-18 15:29:35

 

What is the best way to work this out? Is it by sorting the array by date_added (how do I do this?) or is there a way to simply work it out?

 

Here is the array:

 

Array
(
    [37] => Array
        (
            [out_new] => Array
                (
                    [0] => Array
                        (
                            [application_id] => 23
                            [case_id] => 30
                            [date_added] => 2009-06-18 14:23:37
                            [consumer_id] => 17
                            [introducer_id] => 37
                            [master_id] => 1
                            [introducerName] => introducer1
                        )

                    [1] => Array
                        (
                            [application_id] => 26
                            [case_id] => 32
                            [date_added] => 2009-06-18 09:12:28
                            [consumer_id] => 17
                            [introducer_id] => 37
                            [master_id] => 1
                            [introducerName] => introducer1
                        )

                )

        )

    [43] => Array
        (
            [out_complete] => Array
                (
                    [0] => Array
                        (
                            [application_id] => 28
                            [case_id] => 34
                            [date_added] => 2009-06-18 15:29:35
                            [consumer_id] => 13
                            [introducer_id] => 43
                            [master_id] => 38
                            [introducerName] => introducer6
                        )

                )

        )

)

 

Thanks.

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.