Home > Article > Backend Development > Usage of php mkdir() function
This article mainly introduces the usage of mkdir function in php. It analyzes the method of mkdir function for directory operations in the form of examples. It has certain reference value. Friends who need it can refer to it
The example of this article analyzes the usage of mkdir function in PHP. Share it with everyone for your reference. The specific analysis is as follows: mkdir() syntax: bool mkdir(mkdir() creates a directory with specified permissions. The permissions are, in the same form as file mode() andfileperms(), returning true on success, if an error occurs, then Return FALSE.
php sample code is as follows:<?php if (mkdir("temp", 0701)) print "目录创建成功"; ?>//Output: Directory created successfully
Create a directory with full permissions
The default mode is 0777, which means the maximum possible access Right.
Tips and Comments: mode is ignored under Windows and becomes optional since PHP 4.2.0. Support for context is The recursive parameter was added in PHP 5.0.0. The example code is as follows:<?php mkdir("testing");?>
The above is the detailed content of Usage of php mkdir() function. For more information, please follow other related articles on the PHP Chinese website!