An easy way would be to to convert your code to a function and use
recursion with an is_dir conditional.
Here is a quick example, there are also a few examples in the user notes
at the PHP manual for opendir or readdir.
function lsdir($dir) {
if ($handle = opendir($dir)) {
hey!
this is the code I'm using to get into array all filenames in a directory:
$mydir = mydir //the directory name
$output_file = fopen($data_file, "w");
$begin = "");
fclose($output_file);
chmod($output_file, 0777); //to preview
2 matches
Mail list logo