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, 1671🔥, 0💬
Popular Posts:
How to install "C++/CLI Support" component in Visual Studio? I need to build my Visual Studio C++/CL...
What is EPUB 2.0 Metadata "dc:creator" and "dc:contributor" elements? EPUB 2.0 Metadata "dc:creator"...
How to attach console to a Running Container using the "docker container exec" command? I want to ge...
How To Convert a Character to an ASCII Value? If you want to convert characters to ASCII values, you...
How to use the "set-backend-service" Policy Statement for an Azure API service operation? The "set-b...