How to recursively run into a folder and his subdirectories while adding in each directories an xml file with the content list of the current directory ?
I have tried something like that :
$dir = new DirectoryIterator($folder);
foreach ($dir as $fileinfo) {
$fd=fopen('index.xml','wb');
if (!$fileinfo->isDot() && !is_dir($fileinfo)) {
fwrite($fd,'Something');
}
}
Edit :
the script should do this :
Open dir then create xml file here with the list of files present here (not dirs) Then open next dir, then create xml file here with the list of files present here (not dirs) Etc...