Home >Backend Development >PHP Tutorial >Example analysis of mkdir function usage in php, mkdir example analysis_PHP tutorial
This article analyzes the usage of mkdir function in PHP with examples. Share it with everyone for your reference. The specific analysis is as follows:
mkdir() syntax: bool mkdir (string directory, int permission) dirThe new directory.permissionsOctal number specifies the permissions of a new directory for the new directory.Creates a new directory.
mkdir() creates a directory with specified permissions. The permissions are, in the same form as filemode() and fileperms(), returning true on success and FALSE if an error occurs.
php sample code is as follows:
Explanation: mkdir() attempts to create a new directory specified by path.
The default mode is 0777, which means the greatest possible access.
Tips and Notes
Note: mode is ignored under Windows and becomes optional since PHP 4.2.0. Support for context was added in PHP 5.0.0. The recursive parameter was added in PHP 5.0.0. The example code is as follows:
I hope this article will be helpful to everyone’s PHP programming design.