title: scandir to only show folders, not files
body: <p>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:</p>
  
  <pre><code>$files = array_map("htmlspecialchars", scandir("../images"));       
  
  foreach ($files as $file) {
   $filelist .= sprintf('&lt;option value="%s"&gt;%s&lt;/option&gt;' . PHP_EOL, $file, $file );
  }
  </code></pre>
  
  <p>It works fine but shows all files and folders in 'images', does someone know a way to modify this code so that it only shows folder names found in the 'images' folder, not any other files.</p>
  
  <p>Thanks</p>