我改成这样了也还是不行啊怎么搞得啊
function deldir($dir) {
  $dh=opendir($dir);
  while ($file=readdir($dh)) {
    if($file!="." && $file!="..") {
      $fullpath=$dir."/".$file;
      if(!is_dir($fullpath)) {
          exec("del(rm -rf) $fullpath");
      } else {
          deldir($fullpath);
      }
    }
  }  closedir($dh);
  
  if(rmdir($dir)) {
    return true;
  } else {
    return false;
  }
}
deldir("./gf/");