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.
Â
⇒Working with Directoris and Files in PHP
⇒⇒PHP Tutorials
2016-11-24, 1071👍, 0💬
Popular Posts:
How to View Atom Feeds with IE (Internet Explorer)? If you want to view Atom Feeds with IE (Internet...
Where to see some Examples of Invalid JSON Values? Here are some Examples of Invalid JSON Values: 1....
Where to see some Examples of Invalid JSON Values? Here are some Examples of Invalid JSON Values: 1....
How to dump (or encode, serialize) a Python object into a JSON string using json.dumps()? The json.d...
How to use the "send-request" Policy statement to call an extra web service for an Azure API service...