To list all the files in a directory you would use the following: $handle = opendir('/path/to/folder');
while(($file = readdir($handle)) !== false){
// do things with files
// you will want to filter out things like ., .., and .htaccess
echo $file;
}
Also, to return a list of all the files in a directory, especially with wildcards, use something such as:
$file_array = glob("*"); $files = implode("\n", $file_array);
echo $files;
will give you a list of all the files directly.
Copyright © 2026 eLLeNow.com All Rights Reserved.