Link to home
Start Free TrialLog in
Avatar of SHSUFLIGHT
SHSUFLIGHT

asked on

reverse chrological order

Hey guys, I'm using the following script to pull images out of a folder and throw them onto a website to quickly.  This script works GREAT, but, is there a way to modify this so that it pulls the pics out in reverse chronological order, IE newest first then older:

if (isset($_GET['folder']) && in_array($_GET['folder'],$folders))
{
$path = "./images/gallery/$folder";
$dir_handle = @opendir($path) or die("Unable to open $path");
while (false !== ($file = readdir($dir_handle)))
      {
    if($file == ".")
    continue;
    if($file == "..")
    continue;
    if($file == "Thumbs.db")
    continue;
    echo "<img src=\"./$path/$file\" width=100 height=100><br />";
      echo "<a href=\"./$path/$file\">$file</a><br />";
      }
closedir($dir_handle);
}

ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SHSUFLIGHT
SHSUFLIGHT

ASKER

Spiffy, worked like a charm!!!

Thanks much