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, ∼2115🔥, 0💬
Popular Posts:
How To Read Data from Keyboard (Standard Input) in PHP? If you want to read data from the standard i...
How to use the "set-body" Policy Statement for an Azure API service operation? The "set-body" Policy...
How to use the "forward-request" Policy Statement to call the backend service for an Azure API servi...
How to add request URL Template Parameters to my Azure API operation 2017 version to make it more us...
Where to get the detailed description of the json_encode() Function in PHP? Here is the detailed des...