php创建多级目录代码

6年以前  |  阅读数:1032 次  |  编程语言:PHP 

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

mkdir($path, 0777);   

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

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8