All pastes #77476 Raw Edit

Unnamed

public php v1 · immutable
·published 2006-07-03 02:04 UTC
rendered paste body
<?phpremoveDirectory('test');function removeDirectory($path){  if (is_dir($path))  {    if ($dh = opendir($path))    {      while (($file = readdir($dh)) !== false)      {        if ($file == "." or $file == "..")          continue;        if (is_dir("$path/$file"))        {          removeDirectory("$path/$file");        }        else        {          unlink("$path/$file");        }      }      rmdir("$path") or die("Could not remove $path");    }    else    {      die("Could not open $path");    }  }  else  {    die("$path is not a directory!");  }}?>