php根绝文件路径创建对应的目录

180it 2021-10-15 PM 1323℃ 0条
/**
 * 根绝文件路径创建对应的目录
 * 
 * @param string $path  a/b/c/d/
 * 
 */
function makeDirByPath($path){
    if(!file_exists($path)){
        makeDirByPath(dirname($path));
        mkdir($path, 0777);
    }
}

支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!

标签: none

php根绝文件路径创建对应的目录