- Messages
- 1,682
- Reaction score
- 32
- Points
- 48
How come this code does not work?
it messes up when I add the "&& is_dir($path)" part, other than that it works fine
PHP:
$path = ROOT.'gallery/events';
$dir_handle = @opendir($path) or die("Unable to open $path");
$count = "0";
while ($file = readdir($dir_handle)) {
if ($file!="." && $file!=".." && is_dir($file)) {
$galleryDirectory[$count] = $file;
$count++;
}
}
closedir($dir_handle);
it messes up when I add the "&& is_dir($path)" part, other than that it works fine