I use this code to load images from folder:
$dirname = "media/images/iconized/";
$images = glob($dirname."*.png");
foreach($images as $image) {
echo '<img src="'.$image.'" /><br />';
}
Source: Pull all images from a specified directory and then display them
Works perfect. But load images in alphabetic order (A-Z). My question is:
How to load images from folder by modification date or creation date? To get newest first.
Greetings.