Home > php教程 > php手册 > php 批量创建文件目录方法

php 批量创建文件目录方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:23:10
Original
2170 people have browsed it

php教程 批量创建文件目录方法
class newFold{
 var $upload_dir=date("Y/m/d");
 if(!is_dir($this->upload_dir)){
  $this->mkdir_r($this->upload_dir,0777);
 }

 function mkdir_r($dirName, $rights=0777){
  $dirs = explode('/', $dirName);
  $dir='';
  foreach ($dirs as $part) {
   $dir.=$part.'/';
   if (!is_dir($dir) && strlen($dir)>0)
    mkdir($dir, $rights);
  }
 }
}

// 使用方法

$files = new newFold();

本站原创.net教程">www.bkjia.com


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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template