PHP rmdir() Function

The rmdir() function removes an empty directory.This function returns TRUE on success, or FALSE on failure.

bool rmdir ( string $dirname [, resource $context ] )

Attempts to remove the directory named by dirname. The directory must be empty, and the relevant permissions must permit this. A E_WARNING level error will be generated on failure.

Example -

ParameterDescription
dirSpecifies the directory to be removed
contextSpecifies the context of the file handle. Context is a set of options that can modify the behavior of a stream