Forum Moderators: coopster
i currently use this code to generate a list of jpgs within a folder:
$handle=opendir('path to directory');
$pics=array();
$count=0;
while (($file = readdir($handle))!==false) {
if (substr($file,-4) == ".jpg" ¦¦ substr($file,-4) == ".JPG"){
$pics[$count] = $file;
$count++;
}
}
closedir($handle);
i was wondering if it can be modified to generate a list of directories within a directory?
any help would be appreciated.