note 24196 rejected from function.readdir by maxim
| From: | maxim@php.net | Date: | Fri, 09 Aug 2002 00:02:47 +0000 |
| Subject: | note 24196 rejected from function.readdir by maxim | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-34587@lists.php.net to get a copy of this message | ||
The following snippet doesn't work. The is_file function here doesn't return TRUE for
files. However the !is_dir($file) turns up everything that is not a directory such as . and .. and
links. What am I doing wrong?!
if (false !== ( $dir = opendir($template_path) ) ){
$file_count = 0;
while (false !== ( $file = readdir($dir) ) ){
if (is_file($file)){
$file_name[$file_count] = $file;
$file_count++;
}
}
}