Search the Community
Showing results for tags 'php foreach glob'.
The search index is currently processing. Current results may not be complete.
Hi, Does any one know how to display a message instead of the warning error when there are no files in the folder you are doing a directory list of? I have the following code, which produces a list of files in the folder. The only problem is when the folder is empty. I get a foreach error only when there are no files in the folder. I can forsee that sometimes the folders will be empty so will want to show my own error instead of this server warning. I think the "GLOB_NOCHECK" function may help but this may actually only work with folders rather than files. The code that w