In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what does mkdir refer to in php". In daily operation, I believe that many people have doubts about what mkdir refers to in php. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "what does mkdir mean in php?" Next, please follow the editor to study!
In php, mkdir means "create a directory" and is a built-in function for creating a new directory with the syntax "mkdir ($path,$mode,$recursive,$context)"; it returns TRUE if the directory is created successfully or FALSE if it fails.
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
What does mkdir mean in php
Mkdir is a built-in function in PHP for creating new directories.
Sometimes we need to create a directory on the server. For example, create a directory with the current date as the name to back up the data, or create a directory with the registered user name to store the user registration information file. You can use the mkdir () function in PHP to create a new directory. The syntax format of the function is as follows:
Mkdir ($pathname, $mode, $recursive,$context)
The parameters are described as follows:
$pathname: the directory path to be created (contains the name of the new directory)
$mode: optional parameter, which is used to set the permissions of the directory. It consists of four arrays. The default is 0777 (maximum access rights), but $mode is ignored under Windows.
$recursive: optional parameter. When true, it allows recursive creation of multi-level nested directories specified by $pathname. Default is false.
Context: added support for Context in PHP 5.0.0.
The meaning of the four numbers that make up the $mode parameter is as follows:
The first number is usually 0
The second number specifies the owner's authority.
The third number specifies the permissions of the user group to which the owner belongs
The fourth number specifies the authority of everyone else.
In the $mode parameter, except for the first number, the values of the other three numbers are as follows (if you need to set multiple permissions, you can add the numbers of the corresponding permissions):
1 = > execute permission
2 = > write permission
4 = > read permission.
Use the mkdir () function to create a new directory.
Run the above code to create a directory called test under the current directory and a directory called ttt in the test directory.
It should be noted that when creating a directory using the mkdir () function, the directory name cannot be the same as the existing directory name, and if the same directory name appears, the program will report an error, as shown below:
Warning: mkdir (): File exists in D:\ WWW\ index.php on line 6 at this point, the study of "what does mkdir in php refer to" is over, hoping to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.