Home  >  Article  >  php教程  >  php创建多级目录代码

php创建多级目录代码

WBOY
WBOYOriginal
2016-06-13 12:29:001302browse

function createFolder($path)
{
   if (!file_exists($path))
   {
    createFolder(dirname($path));

    mkdir($path, 0777);
   }
}
createFolder("2007/3/4");//在当前目录下创建2007/3/4的目录结构.

Statement:
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