0

i've made a fancy box showing images uploaded in back-end by my client, but the gallery is showing images by their names, how can i make it showing by date of upload?

this is the fancy-box gallery code:

<?php
  $villa = "img/travaux/villa/";
  $dir = opendir($villa);
  while($file = readdir($dir)){
   $allow_ext = array("jpg",'png','gif');
   $ext = strtolower(substr($file,-3));
   if(in_array($ext,$allow_ext)){
?>
  <a href="img/travaux/villa/<?php echo $file; ?>" class="fancybox-thumb" data-fancybox-group="villa">
<?php
   }
  }
?>
Thibaud
  • 396
  • 5
  • 23

0 Answers0