I have a bit of PHP used to pulled a list of files from my image directory - it\'s used in a form to select where an uploaded image will be saved. Below is the code:
Function is_dir() is the solution :
is_dir()
foreach ($files as $file) { if(is_dir($file) and $file != "." && $file != "..") $filelist .= sprintf('%s' . PHP_EOL, $file, $file ); }