Hi everyone,
I'm using this opendir code to read all the images from a directory and put them into a php file which is then loaded into flash for a flash slideshow. Works great as is right now but I would like to make it so it will randomize the files found in the folder rather than sort by name which is does now.
I've looked at the sort command and I'm lost on how to use it and code it into my existing code. Can someone please lend me a hand. Here's a snipplet of my current code...
if ($handle = opendir($folder)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo '<image><file>'.$file.'</file><caption><![CDATA[NO COMMENT...]]></caption></image>';
}
}
closedir($handle);
}
Thanks in advance!
Evan