//删除目录function delDir($path){ //glob 是遍历目录中的成员,返回数组 foreach(glob($path.'/*') as $f){ is_dir($f)?delDir($f):unlink($f); } //删除目录 rmdir($path);}delDir('demo');