Posted by Matt M. on 02/08/05 23:52
> $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
[Back to original message]
|