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\">$fi le</a><br />";
}
closedir($dir_handle);
}
if (isset($_GET['folder']) && in_array($_GET['folder'],$
{
$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\">$fi
}
closedir($dir_handle);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks much