is_dir() question
| From: | vlad georgescu | Date: | Mon, 26 Sep 2005 08:59:28 +0000 |
| Subject: | is_dir() question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-223165@lists.php.net to get a copy of this message | ||
i have the code below
**
*if ($dir = @opendir("dir2open"))
{
while($file = readdir($dir)) {
//if (($file!='.') && ($file!='..') &&
($file!='.htaccess') && ($file!='
index.php')) {
// if (is_dir($file)) { // print just "." & ".."
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// if (is_file($file)) { // works fine
if (!is_file($file) & ($file!='.') && ($file!='..') ) { // works
fine (print
dir)
print $file."<br>";
}
}
}
closedir($dir);
*
the problem is that, function is_dir() returns true only for "." and ".."
is_file works fine, and I used !is_file() but ..... the question is: what is
wrong here?
i use php4, but i don't think is a bug