Current Location: Home> Function Categories> rmdir

rmdir

Delete directory
Name:rmdir
Category:File system
Programming Language:php
One-line Description:Delete an empty directory.

Definition and usage

rmdir() function deletes an empty directory.

If successful, the function returns true. If it fails, return false.

实例

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

grammar

 rmdir ( dir , context )
parameter describe
dir Required. Specify the directory to be deleted.
context Required. Specifies the environment for file handles. Context is a set of options that can modify the behavior of a stream.

illustrate

Try to delete the directory specified by dir . The directory must be empty and must have corresponding permissions.

Similar Functions
Popular Articles