note 21742 added to function.rmdir
| From: | jcn50 at usa dot net | Date: | Fri, 24 May 2002 23:47:41 +0000 |
| Subject: | note 21742 added to function.rmdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31013@lists.php.net to get a copy of this message | ||
PHP 4.1.2 is missing for a good delete folders function, that's why there's a lot of post
here :p...
Here's my function that removes a directory (empty OR NOT EMPTY) on any Platform (Windows or
Unix/Linux based). Enjoy!
function rmdir2($Path)
{
if (substr_count($SystemDrive,":"))
{system("rmdir/S/Q \"".$Path."\"");}
else {system("rm -r ".$Path);}
}
Remark: add "@" before the system function so you won't get any error display:
@system
--
http://www.php.net/manual/en/function.rmdir.php
http://master.php.net/manage/user-notes.php?action=edit+21742
http://master.php.net/manage/user-notes.php?action=delete+21742
http://master.php.net/manage/user-notes.php?action=reject+21742