So I'm having little trouble, I would like to order randomly all the folders in order to display them in a grid, with thumbnails, so here's my code
<?php
if ($handle = opendir('.')) {
$blacklist = array('.htaccess', '.', '..', 'css', 'js', 'fonts', 'images', 'cv.pdf', 'includes', 'index.php', '.DS_Store', 'About');
echo "<ul class='grid' id='grid'>";
while (false !== ($file = readdir($handle))) {
if (!in_array($file, $blacklist)) {
shuffle($file);
$titre = file_get_contents($file . "/" . "Titre.txt");
$categorie = file_get_contents($file . "/" . "Categorie.txt");
$class_isotope = file_get_contents($file . "/" . "Classe.txt");
echo "<li class='element mix " . $class_isotope . "' ><a href=" . $file . ">
<img src='images/thumb-" . $file . ".jpg' alt='' /><div><h3>" . $titre . "
<span class='subtitle'>" . $categorie . "</span></h3></div></a></li>";
}
}
echo "</ul>";
closedir($handle);
}
?>
I tried to use the shuffle function but it doesn't worked.
If you could help me with that it would be great. thanks in advance.