note 11988 deleted from function.rmdir by jimw
| From: | jimw@php.net | Date: | Wed, 02 Jan 2002 01:28:16 +0000 |
| Subject: | note 11988 deleted from function.rmdir by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-24091@lists.php.net to get a copy of this message | ||
I couldn't get the dir class version of the recursive rmdir to work on WinNT/Apache
1.3.12/PHP4.0.4pl1. But the regular dir handle stuff worked great.
function RmDirR ($dirName) {
$d = opendir ($dirName);
while($entry = readdir($d)) {
if ($entry != "." && $entry != ".." && $entry !=
"") {
if (Is_Dir($dirName."/".$entry)) {
RmDirR($dirName."/".$entry);
} else {
UnLink ($dirName."/".$entry);
}
}
}
closedir($d);
RmDir ($dirName);
}