hi there, i wonder if there's a way of reading a directory in a random order.
With the following code i'm running through the directory thumbs and it's printing images on my website. However, they are always read alphabetically and i wonder if there's a way in doing this randomly?
<?php
$path = 'thumbs';
if ($handle = opendir($path)) {
while (false !== ($file = readdir($handle))) {
if ($file != '.' && $file != '..' && $file != '.DS_Store' && $file != 'Thumbs.db') {
print "<img class='thumb' src='$path/$file'/>";
} else {
//no proper file
}
}
closedir($handle);
}
?>
thank you for your suggestions!
regards