0
My idea is that I could delete all the files inside the folders at once or per period (for example, every 5 months list me these files within the period).
I managed to list all the folders and by clicking on them I can view the files.
Someone could heal with some example to continue from the PHP code below?
EDIT: Basically, it would list all the folders and delete all the files inside the existing folders at once.
Thank you in advance!
CODE:
<?php
$dir = "./";
foreach (glob ($dir."*", GLOB_ONLYDIR) as $pastas) {
if (is_dir ($pastas)) {
echo "Motorista: ";
echo str_replace ( $dir,"",$pastas)." <img style='width: 20px; height: 20px;' src=\"icon-motorista.png\"/> - <a href=\"$pastas\">Olhar pasta</a><br />";
echo "";
}
}
?>
Possible duplicate of How to Delete Folders, Subfolders, and Files?
– Wees Smith
In my case I would go through all the existing folders and delete all the files inside those folders. I don’t want to delete the folders
– JeanTdz