PHP rmdir()Functions


PHP Filesystem 参考手册Complete PHP Filesystem Reference Manual

Definition and Usage

The rmdir() function removes an empty directory.

If successful, the function returns TRUE. If it fails, it returns FALSE.

Syntax

rmdir(dir,context)

Parameters Description
dir Required. Specifies the directory to delete.
context Optional. Specifies the environment of the file handle. context is a set of options that can modify the behavior of the stream.


Example

<?php
$path = "images";
if(!rmdir($path))
{
echo ("Could not remove $path");
}
?>


PHP Filesystem 参考手册Complete PHP Filesystem Reference Manual Other Extensions