I am currently working with a web server that has a directory containing images that are uploaded chronologically from a webcam. My end goal is to have a web page that displays the three most recent images uploaded. I have attempted to do this with the following code:
$files = glob("imageDirectory/*.*");
for ($i=3; $i<count($files); $i++)
$num = $files[$i];
print $num."<br />";
echo '<img height="450px" width="800px" src="'.$num.'" alt="random image" />'."<br /><br />";
However instead of displaying three recent images, it shows all of them. Any advice would be greatly appreciated!