Great!!!
Now, I see what needs to be done, however I need help putting it all together. I've got the directory with the files formatted in the following way:
Now, I have a scritp that reads the files and converts the name in a readable format (eg. December 2005) :
$dirHandle=opendir('/myfullpath/updates/');
while ($file = readdir($dirHandle)) {
if ($file != "." and $file != "..") { //this checks to make sure that it reads only folders.
$month1 = substr("". $file ."", -8, 1);
$month2 = substr("". $file ."", -7, 1);
$mo2dig = substr("". $file ."", -8, 2);
$mos= array($mo2dig);
$year = substr("". $file ."", -6, 2);
if($month1 == '0' and $month2 == '1'){ $month = "January"; }
if($month1 == '0' and $month2 == '2'){ $month = "February"; }
if($month1 == '0' and $month2 == '3'){ $month = "March"; }
if($month1 == '0' and $month2 == '4'){ $month = "April"; }
if($month1 == '0' and $month2 == '5'){ $month = "May"; }
if($month1 == '0' and $month2 == '6'){ $month = "June"; }
if($month1 == '0' and $month2 == '7'){ $month = "July"; }
if($month1 == '0' and $month2 == '8'){ $month = "August"; }
if($month1 == '0' and $month2 == '9'){ $month = "September"; }
if($month1 == '1' and $month2 == '0'){ $month = "October"; }
if($month1 == '1' and $month2 == '1'){ $month = "November"; }
if($month1 == '1' and $month2 == '2'){ $month = "December"; }
echo "<a href='updates/". $file ."'>". $month ." 20". $year ."</a><br>","\n";
}
}
closedir($dirHandle);
In order to sort the files I've created a variable and put all values into an array:
$mos= array($mo2dig);
Now, I'm at a loss of how to sort those titles based on $mos in order to have
January 2005
February 2005
March 2005
etc...
How do I get it sorted? I feel I'm close yet so far... Must be all that Zyrtec fogging my mind...