Creating Directories in PHP


Check for the existence of a directory and create it if it doesn’t exist.

Source Code

if (!file_exists('path/to/directory')) {
    mkdir('path/to/directory', 0777, true);
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments