PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
function listfilesin($dir) {
foreach (glob($dir . "/") as $file) { // list of all files in $dir
echo $file, "<br>\n"; // print filename
if (is_dir($file)) listfilesin($file); // look inside directories too
// note that $file will have the directory name included already
}
}
It means you need a function. Like the one I posted. You only need to make one or two SMALL changes to it to get it to do what you want. Don't show directory names? Then don't print them. Want the file name wrapped in an <option>? Put one in.