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
  • Rename a file or directory rename

    rename

    Renameafileordirecto
  • Change the group to which the file belongs chgrp

    chgrp

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

    fdatasync

    Synchronizedata(butn
  • Read files (safely used in binary files) fread

    fread

    Readfiles(safelyused
  • Find file paths that match patterns glob

    glob

    Findfilepathsthatmat
  • Get the file owner fileowner

    fileowner

    Getthefileowner
  • Read the entire file into an array file

    file

    Readtheentirefileint
  • Returns the total size of the file system or disk partition disk_total_space

    disk_total_space

    Returnsthetotalsizeo
Popular Articles