PHP 8.5.0 Alpha 1 available for testing

Voting

: four minus three?
(Example: nine)

The Note You're Voting On

mmakshita2398 at gmail dot com
6 years ago
it Will Delete All Fildes in folder and that folder too...

echo $path = 'D:\xampp\htdocs\New folder\New folder';

function rmdir_recursive($dir) {
$it = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS);
$it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
foreach($it as $file) {
if ($file->isDir()) rmdir($file->getPathname());
else unlink($file->getPathname());
}
rmdir($dir);
}
rmdir_recursive($path);

<< Back to user notes page

To Top