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
  • is_writable alias is_writeable

    is_writeable

    is_writablealias
  • All remaining data at the output file pointer fpassthru

    fpassthru

    Allremainingdataatth
  • Change the group to which the file belongs chgrp

    chgrp

    Changethegrouptowhic
  • Synchronize data (but not metadata) to a file fdatasync

    fdatasync

    Synchronizedata(butn
  • Return to the directory part in the path dirname

    dirname

    Returntothedirectory
  • Determine whether the given file name is a directory is_dir

    is_dir

    Determinewhethertheg
  • alias for fwrite fputs

    fputs

    aliasforfwrite
  • Read files (safely used in binary files) fread

    fread

    Readfiles(safelyused
Popular Articles