Tools, FAQ, Tutorials:
Removing an Empty Directory in PHP
How To Remove an Empty Directory in PHP?
✍: FYIcenter.com
If you have an empty existing directory and you want to remove it, you can use the rmdir(). Here is a PHP script example on how to use rmdir():
<?php
if (file_exists("/temp/download")) {
rmdir("/temp/download");
print("Directory removed.\n");
} else {
print("Directory does not exist.\n");
}
?>
This script will print:
Directory removed.
If you run this script again, it will print:
Directory does not exist.
2016-11-24, ∼2201🔥, 0💬
Popular Posts:
How to add images to my EPUB books Images can be added into book content using the XHTML "img" eleme...
How to Instantiate Chaincode on BYFN Channel? You can follow this tutorial to Instantiate Chaincode ...
How To Loop through an Array without Using "foreach" in PHP? PHP offers the following functions to a...
How to use the JSON to XML Conversion Tool at utilities-online.info? If you want to try the JSON to ...
What are "*..." and "**..." Wildcard Parameters in Function Definitions? If you want to define a fun...