<?php
function ScanDirectory($Directory){
$MyDirectory = opendir($Directory) or die('Erreur');
//$alowed_doc = array('Saison_1_2006','Saison_2_2007','Saison_3_2008','Saison_4_2009');
$option = array();
while($Entry = @readdir($MyDirectory) ) {
if(is_dir($Directory.'/'.$Entry)){
if(($Entry != '.') && ($Entry != '..') && ($Entry != 'divers') && ($Entry != 'autres')){
$option = ScanDirectory($Directory.'/'.$Entry);
}
}
else {
$allow_ext = array('mp4');
$ext = strtolower(substr($Entry, -3));
if(in_array($ext, $allow_ext)){
$option $Directory.'/'.$Entry] = $Entry ;
}
}
}
closedir($MyDirectory);
return $option;
}
?>
je n'ai pas pris le temps de tester ton code avec la modification (ligne 14, ajout de $option =... ) mais essaye quand même.
au pire je crois que grafikart a fait un tutoriel sur la récursivité... va y faire un petit tour au besoin, sans doute qu'il te permettra de corriger/comprendre le problème