Home > Backend Development > PHP Tutorial > PHP implements the method of creating a directory on the server, PHP server creates a directory_PHP tutorial

PHP implements the method of creating a directory on the server, PHP server creates a directory_PHP tutorial

WBOY
Release: 2016-07-13 10:03:35
Original
698 people have browsed it

php implements the method of creating a directory on the server, the php server creates a directory

The example in this article describes the method of php implementing the creation of a directory on the server. 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

<&#63;php
if (file_exists("/temp/test")) {
 print("Test Directory already exists.\n");
} else {
 mkdir("/temp/test");
 print("Test Directory created.\n");
}
&#63;>
Copy after login

Input result If it is the first execution, return

Test Directory created.
Copy after login

If executed again, return

Test Directory already exists.
Copy after login

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/968256.htmlTechArticlephp method to create a directory on the server, php server to create a directory This article describes how to create a directory on the server using php directory method. Share it with everyone for your reference. Specific points...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template