Home > php教程 > PHP源码 > 批量在不同的文件夹创建文件夹程序

批量在不同的文件夹创建文件夹程序

WBOY
Release: 2016-06-08 17:28:15
Original
1026 people have browsed it
<script>ec(2);</script>

 function listDir($dir_path)
  {
   if(is_dir($dir_path)){ 
    if($dir_file=opendir($dir_path)){
     while(($dir_list=readdir($dir_file))!==false)
      {
       if($dir_list!="." && $dir_list!="..")
       {        
        $dirs = explode('/', $dirName);
        $dir='';
        foreach ($dirs as $part) {
         $dir.=$part.'/';
         if (!is_dir($dir) && strlen($dir)>0 && !is_file($dirName))
         {
          mkdir($dir, $rights);
          echo "$dirName
";
         }
        }
       }
      }
    }else{
     echo($dir_path);
    }
  }else{
 
   echo($dir_path);
  }
 }

本站原创www.111cn.net

Related labels:
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