Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: sorting arrays

  1. #1
    Senior Coder
    Join Date
    May 2004
    Thanked 0 Times in 0 Posts

    sorting arrays

    i have to loop through multiple records and add in both a date and description.

    How can i do this?
    then my real question is - once i do this and have multidimensional array with dates and description -- how can I sort the array by date (and what format does the date have to be stored in to sort )

    Please advise?

  • #2
    Regular Coder PremiumBlend's Avatar
    Join Date
    Apr 2006
    Marion, Iowa
    Thanked 13 Times in 13 Posts
    I think you'll have to create your own sorting algorithm. Here is a link to an example to do so with a 2-dimensional array.

    2D Array Sort

    If you can store your dates as strings in the format "2007-09-04 13:43:00" you'll be able to sort them alphanumerically.
    My Website: DumpsterDoggy


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts