This function will list all the files from a folder. Give the folder as a parameter.
PHP code:
listFolder
("folder/");
function listFolder($folder){
$folderData = opendir($folder);
while (($file = readdir($folderData)) !== false){
echo "File name: ".$file."<br />";
echo "File type: ".filetype($folder.$file)."<br />";
echo "File path: ".$folder.$file."<br /><br />";
}
closedir($folderData);
}