10-11-2008, 03:05 PM
|
#4 (permalink)
|
|
The Frequenter
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
|
Perhaps the directory you're trying to read is empty, foreach expects an array, and glob returns a boolean false value on error. php.net itself says:
Quote:
|
Originally Posted by php.net
Note: On some systems it is impossible to distinguish between empty match and an error.
|
Add a check before jumping into the foreach and it should be all good:
PHP Code:
if(is_array($dirs) && count($dirs) > 0) { foreach($dirs as $dir) ... }
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
|
|
|
|