I've written some PHP to call all images from a directory and display them on a HTML page. As the file names are randomly generated to be identified for our online inventory system, I need them to be displayed in order they were uploaded to the system.
Below is the code I have written so far, am I correct in thinking it needs an if statement adding to it? Any help appreciated!
$dirname = "../dashboard/uploads/$inventory/";
$images = glob($dirname."*.jpg");
foreach($images as $image) {
echo '<img src="'.$image.'" class="print-images">';
}