Home >Backend Development >PHP Tutorial >PHP implements the method of deleting empty directories, PHP implements empty directories_PHP tutorial

PHP implements the method of deleting empty directories, PHP implements empty directories_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:03:34834browse

php implements the method of deleting empty directories, php implements empty directories

The example in this article describes the method of php deleting empty directories. Share it with everyone for your reference. The specific analysis is as follows:

You can delete an empty directory through the rmdir() function in php

<&#63;php
if (file_exists("/temp/test")) {
 rmdir("/temp/test");
 print("Directory removed.\n");
} else {
 print("Directory does not exist.\n");
}
&#63;>

The above code will return

when executed for the first time
Directory removed.

The second execution will return

because the directory has been deleted.
Directory does not exist.

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/968257.htmlTechArticleHow to delete empty directories in php, how to delete empty directories in php. This article describes how to delete empty directories in php. Share it with everyone for your reference. The specific analysis is as follows: In php, you can pass...
Statement:
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