note 123670 added to function.rmdir
| From: | mmakshita2398 at gmail dot com | Date: | Fri, 08 Mar 2019 08:19:03 +0000 |
| Subject: | note 123670 added to function.rmdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-210339@lists.php.net to get a copy of this message | ||
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);
----
Server IP: 208.43.231.9
Probable Submitter: 185.85.3.194 (proxied: 14.102.127.50)
----
Manual Page -- http://php.net/manual/en/function.rmdir.php
Edit -- https://master.php.net/note/edit/123670
Del: integrated -- https://master.php.net/note/delete/123670/integrated
Del: useless -- https://master.php.net/note/delete/123670/useless
Del: bad code -- https://master.php.net/note/delete/123670/bad+code
Del: spam -- https://master.php.net/note/delete/123670/spam
Del: non-english -- https://master.php.net/note/delete/123670/non-english
Del: in docs -- https://master.php.net/note/delete/123670/in+docs
Del: other reasons-- https://master.php.net/note/delete/123670
Reject -- https://master.php.net/note/reject/123670
Search -- https://master.php.net/manage/user-notes.php