I'm trying to remove a directory with PHP.
I unlink/remove all files/subdirs from the inside out and finally call rmdir on the now empty top directory. Everything goes according to plan until the last call to rmdir. PHP warns that the directory is NOT emtpy and refuses to remove it. But when I look at the directory in the explorer it is empty, after all.
I also tried a well known recursive function with the same result.
The operating system is Windows 7 with Xampp and there are no access restrictions for any of the elements in question.
Any ideas?
Can you try this one?
<?php
$handle = opendir($dirpath);
//do whatever you need
closedir($handle)
rmdir($dirpath);
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With