Note Submitter: michael
Reason: useless
----
another simple recursive function deleting a directory
<?
function removeDirRecursive($toDelete)
{
$dir = opendir($toDelete);
while(false !== ($file = readdir($dir)))
{
if(($file != '.') AND ($file != '..'))
{
if(is_dir($toDelete.'/'.$file))
{
removeDirRecursive($toDelete.'/'.$file);
}
if(is_file($toDelete.'/'.$file))
unlink($toDelete.'/'.$file);
}
}
closedir($dir);
rmdir($toDelete);
return true;
}
?>
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|