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, ∼2372🔥, 0💬
Popular Posts:
Where to find tutorials on Microsoft Azure services? Here is a large collection of tutorials to answ...
How to install "The Windows SDK version 8.1"? I need to build my Visual Studio C++ applications. If ...
How To Merge Cells in a Column? If you want to merge multiple cells vertically in a row, you need to...
How to convert a JSON text string to an XML document with PHP language? Currently, there is no built...
Can Two Forms Be Nested? Can two forms be nested? The answer is no and yes: No. You can not nest two...