View Full Version : sorting arrays

09-04-2007, 07:49 PM
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?

09-04-2007, 08:43 PM
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 (http://www.4guysfromrolla.com/webtech/011601-1.shtml)

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.