mkdir()
We learned one way to create a file with file_put_contents(), but what about creating a directory? This is your function.
All you really need is the path to the directory you want to create. By default it will be created with permissions of 0777. You can also specify those permissions in the second parameter just as you would with chmod().
The third parameter is one to remember. With this set to true, it will create all the directories it needs to get to the one you want. For example, if you want to create /this/that/other/ but only the “this” directory exists, set the third parameter to true and both directories “that” and “other” will be created. By default it’s false; nothing would be created and you would get a warning.
The fourth parameter is for any stream context (see manual).
// sample usage mkdir( '/secret' ); mkdir( '/secret', 0644 ); mkdir( '/secret/agent', 0755, true );
