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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.