note 78463 deleted from function.rmdir by aidan
| From: | aidan@php.net | Date: | Wed, 15 Apr 2009 04:22:56 +0000 |
| Subject: | note 78463 deleted from function.rmdir by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-153247@lists.php.net to get a copy of this message | ||
Note Submitter: webmaster at gprodesign dot com
----
For those still using PHP 4, here is an alternative to the last post:
<?php
function deltree($path) {
if (is_dir($path)) {
if ($handle = opendir($path)) {
while (false !== ($file = readdir($handle))) {
if ($file != '.' && $file != '..') {
unlink($path."/".$file);
}
}
closedir($handle);
rmdir($path);
return 1;
}
}
return;
}
?>