php删除一组文件的例子

原创
2016-07-25 08:56:05 574浏览
  1. file1.html
  2. file2.html
  3. file3.html
复制代码

2,删除一组文件的代码 process.php

  1. # Take each checked value, and give it a name of $delete
  2. foreach($_POST['delete'] as $delete){
  3. # Make sure the file actually exists
  4. if(file_exists("/location/of/directory/".$delete)){
  5. # Delete each file
  6. unlink("/location/of/directory/",$delete);
  7. }else{
  8. continue;
  9. }
  10. }
  11. # Return to form.html
  12. header("Location: form.html");
  13. ?>
复制代码

您可能感兴趣的文章:

Php删除指定文件与文件夹的方法 PHP删除N分钟前创建的所有文件的小例子 php实例:批量删除文件夹及文件夹中的文件 删除指定文件夹中所有文件的php代码 删除多级目录的php自定义函数 php递归删除文件与目录的代码 php递归删除目录及多级子目录下所有文件的代码 php递归创建和删除文件夹的代码 php递归删除目录的例子


声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
上一条:php日历代码(附演示效果) 下一条:php日历代码 php实现的高效日历代码

相关文章

查看更多