So, what kind of problems do you have exactly? To read directories you should use opendir() and readdir(), of course. Here is how I create arrays of directories and files in certain directory in one of my projetcs. Instead of creating arrays you can just print out result in a tree view. To form tree view you should use, I suppose, images with branches - it is not difficult: if current file is two levels in main root directory, you show 2 images before file name, if one level - one image. Questions are welcome.
function read_dir($start_dir){
global $file_arr;
global $dir_arr;
$i=sizeof($dir_arr);
$j=sizeof($file_arr);
$handle=opendir($start_dir);
while ($file = readdir($handle)) {
if ($file != "." && $file != "..") {
if (is_file($start_dir.'/'.$file)<>0){
//It is file
$file_arr[$j]=$start_dir.'/'.$file;
$j++;
}
}elseif(is_dir($start_dir.'/'.$file)<>0){
//It is directory
$dir_arr[$i]=$start_dir.'/'.$file;
$i++;
}
}
}
closedir($handle);
}
$i=0;
$dir_arr[0]="http://www.Projetcs/MyProject";
while ($dir_arr[$i]){
read_dir($dir_arr[$i]);
$i++;
}