Page 1 of 1

getting a complete file list?

Posted: Fri Aug 29, 2003 5:01 am
by irealms
Is there any way of generating a text list of all files within a folder and sub folders?

Posted: Fri Aug 29, 2003 6:23 am
by Judas
sure there is.

here is a function i wrote.

Code: Select all

function readFiles($map){
if ($handle =@ opendir($map)) {
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != "..") {
        $filesї]=$map.'/'.$file;
        }
    }
    closedir($handle);
}

if (!empty($files)){return $files; }
}