php删除文件夹及其下面的文件
2013-01-31 14:07
246 查看
php删除文件:unlink()函数
php删除文件夹及其下面的文件:
<?php echo unlink('test.doc'); ?>
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; } }
相关文章推荐
- php删除文件夹及其文件夹下所有文件
- php删除文件夹及其文件夹下所有文件
- php删除文件夹及其文件夹下所有文件
- php删除文件夹及其文件夹下所有文件
- Java 删除空文件夹和文件夹及其下面的文件
- php删除文件夹及其文件夹下所有文件
- php删除 复制文件夹及其文件夹下所有文件
- php删除与复制文件夹及其文件夹下所有文件的实现代码
- php删除与复制文件夹及其文件夹下所有文件的实现代码
- php删除/复制文件夹及其文件夹下所有文件
- php删除文件夹及其文件夹下所有文件的函数代码
- php删除文件夹及其文件夹下所有文件
- php删除文件夹及其文件夹下所有文件
- php删除文件夹及下面的文件
- php删除文件夹及其文件夹下所有文件
- Python_删除/创建指定目录及其下所有子目录的文件,该文件记录当前文件夹的内容
- java删除文件夹及其文件的方法
- php实现的遍历文件夹下所有文件,编辑删除
- java 删除指定文件夹 以及文件下下面的所有文件