Re: is_dir & is_file bugs?

From: Date: Tue, 08 Feb 2005 22:00:35 +0000
Subject: Re: is_dir & is_file bugs?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-208299@lists.php.net to get a copy of this message
Nope! It doesnt work either... :( Matt M. wrote:
$path = 'product_images'; $handle = opendir($path); while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != "..")
       {
echo $file;
           if (is_dir($file))
           {
               echo ' <-- folder<br>';
               $folders[] = $file;
           }
           elseif (is_file($file))
           {
               echo ' <-- image<br>';
               $images[] = $file;
           }
           else
           {
               echo ' <-- ???<br>';
           }
       }
}
try the absolute path in is_dir and is_file


« previous php.general (#208299) next »