<?php
$current_dir = "/members/downloads/board-meetings/2014/"; // Full path to directory
$dir = opendir($current_dir); // Open directory
echo ("");
while ($file = readdir($dir)) // while loop
{
$parts = explode(".", $file); // Pull apart the name and dissect by period
if (is_array($parts) && count($parts) > 1) {
$extension = end($parts); // Set to see last file extension
if ($extension == "pdf" OR $extension == "PDF") // PDF DOCS by extention
echo "<li class=\"pdf\"><strong><a href=\"/members/downloads/board-meetings /$file\" class=\"underline\" target=\"_blank\">$file</a></strong></li>"; // If so, echo it out!
}
}
echo "<br>";
closedir($dir); // Close the directory
?>
I was hoping to ask for some help from an Expert. This code works great except that this site needs to list the filenames by month. They are named like: January.pdf, February.pdf etc... And they need to be listed in reverse monthly order. So December.pdf, then November.pdf etc... And I get: October.pdf November.pdf April.pdf - way off base. Any ideas would be extremely appreciated.