I'm trying to make a list of music, I have all the music in a folder and I want every time the screen refreshes, I get disordered, I already managed to call all the music in the folder with dir()
, but what I do not get it is that every time the screen is refreshed I mess up the folder, I understand that it is done with shuffle()
, but it is not working.
I will leave you a part of my code:
<?php
$path="../mimusica"; //El directorio local donde almacena los archivos
$directorio= dir($path);
while ($archivo = $directorio->read();)
{
$replace_mp3 = str_replace(".mp3","",$archivo);
echo shuffle($replace_mp3)."<br>";
}
$directorio->close();
?>