I am trying to set up a slideshow but want to have it dynamic that all someone has to do is add an image to the folder to have it included in the slideshow.
This is part of what I have so far and it works as expected. However, I want to include latest images first, at present it goes by file name of what is first alphabetically.
foreach(glob('media/slides/*.JPG') as $image){
if($image_count <'15'){
echo '<img class="slides" src="'.$image.'">';
}
$image_count++;
}
I can get the date from the meta like so:
$exif_data = exif_read_data($image);
echo $exif_data['FileDateTime'];
But not sure how to go about ordering them accordingly.