Reputation: 63
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.
Upvotes: 0
Views: 1135
Reputation: 208042
You need to call mkdir
with the recursive flag before runing the copy
mkdir("/path/to/my/dir", 0700,true);
Upvotes: 1