Thank you .
I was using something similar however since I was not succesfull now I am working with your example
I am trying this now
$path = "/home/test/public_html/mailtest";
if ($handle = opendir("$path")) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
# unlink($path . $file);
echo "<br>$path/$file";
}
}
}
closedir($handle);
As can you see I commented # unlink to avoid damages
and I inserted a echo line .
The script returns this
/home/test/public_html/mailtest/inbox
/home/test/public_html/mailtest/info
/home/test/public_html/mailtest/dream
/home/test/public_html/mailtest/sent-mail
/home/test/public_html/mailtest/saved-messages
/home/test/public_html/mailtest/neomail-trash
/home/test/public_html/mailtest/mago
/home/test/public_html/mailtest/inbox.pop
these are all directories .
Unluckly ,
1)..it doesn't report subdirectories for each directory
2)..it doesn't report files inside each directory ..
3)..it doesn't report files contained on /home/... /mailtest/
When I will be able to list all them (files and directories
on /home/test/public_html/mailtest/ something similar to
#ls -R using php ) , then It will be
easy to insert an if code to unlink only files
that are equal to $file1 or $file2 ...
Now the problem is to solve points 1) 2) 3) ...🙁