I have some PHP used to pull a list of files from my image directory - it is used in the form to select where the downloaded image will be uploaded. Below is the code:
$files = array_map("htmlspecialchars", scandir("../images")); foreach ($files as $file) { $filelist .= sprintf('<option value="%s">%s</option>' . PHP_EOL, $file, $file ); }
It works fine, but it shows all the files and folders in the "images", someone knows a way to change this code so that it only displays the names of the folders found in the "images" folder, and not any other files.
thanks
php
user2574794
source share