Re: is_dir & is_file bugs?

From: Date: Tue, 08 Feb 2005 21:52:09 +0000
Subject: Re: is_dir & is_file bugs?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-208297@lists.php.net to get a copy of this message
> $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 (#208297) next »