function del_dir($dir){
	if(!file_exists($dir)){
		die('目录不存在');
	}
	$handle_dir = opendir($dir);
	while ($file = readdir($handle_dir)){
		if($file!='.' && $file!='..') {
			$fullpath=$dir.'/'.$file;
		 	if(!is_dir($fullpath)) {
				unlink($fullpath);
			}else{
				del_dir($fullpath);
			}
		}
	}
	closedir($handle_dir);
	return rmdir($dir);
}

2 Comments

  1. This is the best blog for anyone who desires to search out out about this topic. You notice so much its virtually arduous to argue with you (not that I really would need…HaHa). You definitely put a brand new spin on a subject thats been written about for years. Nice stuff, simply nice!

  2. I am not truly sure if greatest practices have emerged around things like that, but I am sure that your good job is clearly identified. I was thinking if you offer any subscription to your RSS feeds as I would be very interested but i can’t find any link to register here.Where is it? My kindest regards, Bibi.

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


*