循环创建目录

function createDir($path){
    if (!file_exists($path)){
        createDir(dirname($path));
        mkdir($path, 0777);
    }
}

编程技巧