Hello all,
How can I load all images in a certain directory in alphabetical order. Currently I have this code which loads all the images, however the order is random.
<?php $dir = "path-to/images";
//open dir
if ($opendir = opendir($dir))
{
//read dir
while (($file = readdir($opendir)) !==FALSE)
{
if ($file!="."&&$file!="..")
echo "<img src='$dir/$file'>";
}
}
?>
Please bear in mind I don't know php. This code is something I found on the net and just copied it.
Thank you in advance,
krko