I have the following code:
<?php
$dir_handle = 'assets/splashs/';
foreach(array_diff(scandir($dir_handle), array('.', '..')) as $file) {
echo '<img id="preload_header" src="assets/splashs/' . $file . '" /><br />';
}
?>
I wondered if it were possible to check if the image is successfully loaded, if so then remove the image and move onto the next?
My splashs folder has over 600 images in it, I don't want 600 images just sitting around on the side, but i'd like them to be preloaded for when I call them elsewhere.
load image => successfully loaded => remove and onto next image
=> unsuccessfully loaded => remove image and stop
Thanks for any help in advance.