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, ∼2179🔥, 0💬
Popular Posts:
How To Avoid the Undefined Index Error in PHP? If you don't want your PHP page to give out errors as...
Tools, FAQ, Tutorials: JSON Validator JSON-XML Converter XML-JSON Converter JSON FAQ/Tutorials Pytho...
How To Copy Array Values to a List of Variables in PHP? If you want copy all values of an array to a...
How to login to Azure API Management Publisher Dashboard? If you have given access permission to an ...
How To Set session.gc_divisor Properly in PHP? As you know that session.gc_divisor is the frequency ...