Hi All,
I am trying to sort an array in order of date, newest at the start.
I have a multi array as follows:
$dir = opendir($current_dir);
$i = 0;
$dir_array = array();
while ($file = readdir($dir))
{
if (ereg("0...", $file)) {
$FileNew = "20".$file;
}
else { $FileNew = "19".$file;}
$YearName = SubStr($FileNew, 0, 4);
$WeekName = SubStr($FileNew, 4);
$dir_array[$i][1] = $file;
$dir_array[$i][2] = "Year $YearName, Week $WeekName: ";
$i++;
}
closedir($dir);
rsort($dir_array);
I was expecting it to out put the dates of 19xx at the end and dates of 20xx at the start, but its not working that way, it sorts all 20xx dates fine but still has 19xx dates at the start.
any ideas folks?
thanks a lot.