PHP Implementation method to delete empty directory
This article mainly introduces the method of PHP implementation to delete empty directory, example analyzes the use of rmdir function skills, with a certain reference value, the need for friends can refer to the next
The example in this article describes how PHP implements the removal of empty directories. Share to everyone for your reference. The specific analysis is as follows:
An empty directory can be removed from PHP using the rmdir () function
?
1 2 3 4 5 6 7 8 |
if (file_exists ("/temp/test")) { RmDir ("/temp/test"); Print ("Directory removed.\n"); } else { Print ("Directory does not exist.\n"); } ?> |
The first execution of the above code returns
?
The second execution, because the directory has been deleted, will return
?
1 |
Directory does not exist. |
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/968670.html www.bkjia.com true http://www.bkjia.com/PHPjc/968670.html techarticle the method of removing empty directory by PHP This article mainly introduces the method of removing empty directory by PHP, the example analyzes the use skill of rmdir function, has a certain reference value, needs a friend ...