This article mainly introduces the PHP implementation on the server to create a directory, example analysis of PHP using the mkdir function of the use of skills, the need for friends can refer to the
This article illustrates how PHP implements the directory creation on the server. Share to 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 using the mkdir () function
?
1 2 3 4 5 6 7 8 |
<?php if (file_exists ("/temp/test")) {print ("Test Directory already EXISTS.N");} else {mkdir ("/temp/test"); Print ("T EST Directory created.n "); }?> |
Enter the result if it is the first time it is executed, return
?
1 |
Test Directory created. |
If executed again, return
?
1 |
Test Directory already exists. |
I hope this article will help you with your PHP program design.