This article mainly introduces the method of creating a directory on the server in php, and analyzes the use of the mkdir function in php with examples. Tips, friends in need can refer to it
The example in this article describes the method of creating a directory on the server in PHP. Share it with everyone for your reference. The specific analysis is as follows:
The following code first determines whether the directory exists, and then creates a directory on the server through the mkdir() function
?
3 4
5
6
|
if (file_exists("/temp/test")) { print("Test Directory already exists.n");
print("Test Directory created.n"); } ?> |
1 |
Test Directory created. |
1 | Test Directory already exists. |