?
Path : /home/admin/public_html/old/ |
Current File : /home/admin/public_html/old/class.folders.php |
<? /* this was developed to easily get the files/directory tree , not perfect for some but works for me :) developed by sab malik http://www.decodeit.biz you are free to use this code and distribute it but please keep the credits :) */ class folders{ var $folders; function folderlist($folder_path = "" , $tree=true){ $handle = opendir($folder_path."/."); //-- open the directory to get all the files while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if(is_dir($folder_path."/".$file)){ $this->folders[] = $folder_path."/".$file; if($tree) $this->folderlist($folder_path."/".$file); } } } return $this->folders; } function filelist($folder_path){ $files = array(); $handle = opendir($folder_path."/."); //-- open the directory to get all the files while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if(!is_dir($folder_path."/".$file)){ $files[] = $folder_path."/".$file; } } } return $files; } } ?>