I have a folder where i upload photos every day and they are displayed on a webpage from my site, like a gallery. The problem is that last uploaded photos are not shown in top, because they are sorted by name not by date.
Is it possible to sort them by date and after that to show them on the page?
<?php
$files = (glob("../catalog-reseller/wall/diverse/*.jpg")); rsort($files);
foreach (array_slice($files, 0) as $filename)
{ $x=$x+1;
echo'
<a href="'.$filename.'" data-rel="lightcase:gallery" title="Caption Text">
<img src="'.$filename.'" alt="">
</a>';
if($x==50){break;}
}
?>