deleteDir($path.'/'.$entry); if ($res == -1) { @closedir ($dir); return -2; } else if ($res == -2) { @closedir ($dir); return -2; } else if ($res == -3) { @closedir ($dir); return -3; } else if ($res != 0) { @closedir ($dir); return -2; } } else if (is_file ($path.'/'.$entry) || is_link ($path.'/'.$entry)) { $res = @unlink ($path.'/'.$entry); if (!$res) { @closedir ($dir); return -2; } } else { @closedir ($dir); return -3; } } @closedir ($dir); $res = @rmdir ($path); if (!$res) return -2; return 0; } static public function standardDirFormat() { $args = func_get_args(); $i=0; $path=""; foreach($args as $piece) { if($i>0 && (substr($piece,0,2) == "./" || substr($piece,0,2) == ".\\")) { $path .= substr($piece,2); }else if($i==0) { $path .= $piece; } } if(substr($path, -1) != "/" && substr($path, -1) != "\\") $path = $path . DIRECTORY_SEPARATOR; else $path = $path; return $path; } } ?>