开发者

php copy file with its path

开发者 https://www.devze.com 2023-02-18 09:57 出处:网络
in php: how to copy a file existng in 1/2/3 directory to folder 0 ,but if the nested folders 1/2/3 are not exist in 0,

in php: how to copy a file existng in 1/2/3 directory to folder 0 , but if the nested folders 1/2/3 are not exist in 0, it should create that folders (1 and 2 and 3), then copy the file into.开发者_如何转开发 thanks.


You need to call mkdir with the recursive flag before runing the copy

mkdir("/path/to/my/dir", 0700,true);
0

精彩评论

暂无评论...
验证码 换一张
取 消