note 72166 added to function.rmdir
| From: | php-general at lists dot php dot net | Date: | Fri, 05 Jan 2007 13:10:30 +0000 |
| Subject: | note 72166 added to function.rmdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-121317@lists.php.net to get a copy of this message | ||
This code won`t work if you have subdirectories with new subdirecories.
Add this:
if(!@rmdir($subDir)) //@ suppress the warning message
{
recursiveRemoveDirectory($subDir);
rmdir($subDir);
}
.. or it wont delete your sub-subdirectories. Took me quite some time to figure out this..
----
Server IP: 83.137.200.2
Probable Submitter: 80.203.156.250
----
Manual Page -- http://www.php.net/manual/en/function.rmdir.php
Edit -- https://master.php.net/note/edit/72166
Del: integrated -- https://master.php.net/note/delete/72166/integrated
Del: useless -- https://master.php.net/note/delete/72166/useless
Del: bad code -- https://master.php.net/note/delete/72166/bad+code
Del: spam -- https://master.php.net/note/delete/72166/spam
Del: non-english -- https://master.php.net/note/delete/72166/non-english
Del: in docs -- https://master.php.net/note/delete/72166/in+docs
Del: other reasons-- https://master.php.net/note/delete/72166
Reject -- https://master.php.net/note/reject/72166
Search -- https://master.php.net/manage/user-notes.php