> Just something I havent been able to sort out in the archives, but what im 
> wanting to do it this. Do a listing of all files in a directory, and load 
> up an array with each returned filename.

$files_dir = "/tmp";
chdir($files_dir);
$dir_handle = @opendir($files_dir) or die("Unable to open $files_dir");
$files = array();
while ($file = readdir($dir_handle)) {
        array_push($files, $file);
}
closedir($dir_handle);
sort($files);
reset($files);
for ($i = 0; $i < count($files); $i++) {
        echo "$files[$i] <br>";
}


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to