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

WBOY
Release: 2016-07-13 10:03:34
Original
807 people have browsed it

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;>
Copy after login

The above code will return

when executed for the first time
Directory removed.
Copy after login

The second execution will return

because the directory has been deleted.
Directory does not exist.
Copy after login

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...
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!