I have made a php file manager and in one part I'm using foreach to look for files. The only problem is that if there are no files in a folder(if none have been added yet) then the foreach statement leaves an error. I don't want it to leave an error.
Is there any way to disable it from leaving an error if it doesn't read anything? I don't want to disable errors for the whole page.
Foreach statements. Returns error if no match.
Moderator: General Moderators
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm