|
$pictures = array();
$musics = array();
$others = array();
$path = "./bordel";
$dir_handle = @opendir($path) or die("Impossible d'ouvrir le chemin '$path'");
while ($file = readdir($dir_handle))
if ($file != "." && $file != "..")
{
$extension = get_file_extension($file);
switch ($extension)
{
case ".jpg":
case ".JPG":
case ".bmp":
case ".BMP":
$pictures[] = $file;
break;
case ".mp3":
case ".MP3":
$musics[] = $file;
break;
default:
$others[] = $file;
break;
}
}
closedir($dir_handle);
display_files("Musiques", $path, $musics);
display_files("Images", $path, $pictures);
display_files("Autres", $path, $others);
?>
|