Try this, using mkdir:
if (!file_exists('path/to/directory')) {
mkdir('path/to/directory', 0777, true);
}
Note that 0777
is already the default mode for directories and may still be modified by the current umask.
Try this, using mkdir:
if (!file_exists('path/to/directory')) {
mkdir('path/to/directory', 0777, true);
}
Note that 0777
is already the default mode for directories and may still be modified by the current umask.
I'm getting an IndentationError (or a TabError). How do I fix it?
How do I clone a list so that it doesn't change unexpectedly after assignment?
List of lists changes reflected across sublists unexpectedly
How to test multiple variables for equality against a single value?
How do I create variable variables?
Asking the user for input until they give a valid response
How can I access and process nested objects, arrays, or JSON?