Home > php教程 > php手册 > body text

php删除目录的函数

WBOY
Release: 2016-06-13 11:16:55
Original
1019 people have browsed it

php删除目录的函数  

实例应用做删除有文件目录的函数:
function scmulu($mlming)
{
 $dkml = opendir($mlming);
 readdir($dkml);
 readdir($dkml);
 while(($wj = readdir($dkml))!==false)
 {
  $wj = $mlming.DIRECTORY_SEPARATOR.$wj;
  if(is_dir($wj))
  {
   scmulu($wj);
  }else
  {
   if(unlink($wj))
   {
    echo "文件$wj删除成功
";
   }else
   {
    echo "文件$wj删除失败
";
   }
  }
 }
 closedir($dkml);
  if(rmdir($mlming))
  {
   echo "目录$mlming删除成功
";
  }else
  {
   echo "目录$mlming删除失败
";
  }
}


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!