note 106634 added to function.rmdir
| From: | stephane at osu1 dot php dot net | Date: | Wed, 23 Nov 2011 15:29:51 +0000 |
| Subject: | note 106634 added to function.rmdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184639@lists.php.net to get a copy of this message | ||
Thomas you are right.
Function deleteAll given by O S on 18-Jun-2010 11:30 will fail because readdir is not use correctly.
It should be :
while (false !== ($contents = readdir($directoryHandle))) {
and not :
while ($contents = readdir($directoryHandle)) {
See the readdir "Return value" function.
-- Warning --
This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to
FALSE, such as 0 or "". Please read the section on Booleans for more information. Use the
=== operator for testing the return value of this function.
----
Server IP: 69.147.83.197
Probable Submitter: 88.180.12.126
----
Manual Page -- http://www.php.net/manual/en/function.rmdir.php
Edit -- https://master.php.net/note/edit/106634
Del: integrated -- https://master.php.net/note/delete/106634/integrated
Del: useless -- https://master.php.net/note/delete/106634/useless
Del: bad code -- https://master.php.net/note/delete/106634/bad+code
Del: spam -- https://master.php.net/note/delete/106634/spam
Del: non-english -- https://master.php.net/note/delete/106634/non-english
Del: in docs -- https://master.php.net/note/delete/106634/in+docs
Del: other reasons-- https://master.php.net/note/delete/106634
Reject -- https://master.php.net/note/reject/106634
Search -- https://master.php.net/manage/user-notes.php