Sort 2D array by date
Posted: Fri Dec 18, 2009 3:11 am
Hi, I have some code that sorts an array of dates that I first convert into YYYYDDMM format with sort($ISOSDates, SORT_NUMERIC). What I need to do is add a piece of data to each to each date array that is being sorted before it's sorted. So if I have an array sortedDateData that has dates added to it like this:
sortedDateData[$i] = array($year$monthNum$dayNum, $mediaId).
how can I sort the array by $year$monthNum$dayNum?
So the new sortedDateData[0][0] would have the first date
then sortedDateData[1][0] would have the next date
thanks,
4dplane
sortedDateData[$i] = array($year$monthNum$dayNum, $mediaId).
how can I sort the array by $year$monthNum$dayNum?
So the new sortedDateData[0][0] would have the first date
then sortedDateData[1][0] would have the next date
thanks,
4dplane