PHP头条
热点:

php删除文件夹及其文件夹下所有文件


   function deldir($dir) {

  $dh=opendir($dir);

  while ($file=readdir($dh)) {

  if($file!="." && $file!="..") {

  $fullpath=$dir."/".$file;

  if(!is_dir($fullpath)) {

  unlink($fullpath);

  } else {

  deldir($fullpath);

  }

  }

  }

  closedir($dh);

  if(rmdir($dir)) {

  return true;

  } else {

  return false;

  }

  }

www.phpzy.comtrue/php/14067.htmlTechArticlephp删除文件夹及其文件夹下所有文件 function deldir($dir) { $dh=opendir($dir); while ($file=readdir($dh)) { if($file!=. $file!=..) { $fullpath=$dir./.$file; if(!is_dir($fullpath)) { unlink($fullpath); } else { deldir($fullpath)...

相关文章

    暂无相关文章
相关频道:

PHP之友评论

今天推荐