PHP rmdir() Function
❮ PHP Filesystem ReferenceExample
Remove "images" directory:
<?php
$path = "images";
if(!rmdir($path)) {
echo ("Could not remove $path");
}
?>
Definition and Usage
The rmdir() function removes an empty directory.
Syntax
rmdir(dir, context)
Parameter Values
Parameter | Description |
---|---|
dir | Required. Specifies the path to the directory to be removed |
context | Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream |
Technical Details
Return Value: | TRUE on success, FALSE on failure |
---|---|
PHP Version: | 4.0+ |
❮ PHP Filesystem Reference