Hi,
The code below seems to work when I specify the root directory:
i.e.
$dir = opendir("./");
But when I specify a sub-directory,
i.e.
$dir = opendir("original_files");
the filename (named $file in the code) returns false for both is_file and is_dir regardless whether it is actually a file or a directory. Can anyone point me out where I am going wrong?
<?php
$dir = opendir("original_files");
echo '<ul>';
while ($file = readdir($dir)) {
echo '<li>'.$file.'</li>';
echo 'File: ';
var_dump((is_file($file)));
echo 'Directory: ';
var_dump((is_dir($file)));
}
echo '</ul>';
closedir($dir);
?>
Thanks heaps,
Global