PHP rmdir() Function

PHP rmdir Function


Definition :

In this tutorial we have learned about PHP rmdir() Function.The PHP rmdir() Function is inbuilt function.The PHP rmdir() function is used to attempts to remove the specified directory. The directory must be empty, and must have the relevant permissions to perform the activity.

Syntax

   rmdir(directory, context)

 Parameters ;

directory Required. Specify the path to the directory to be removed.
context Optional. Specify the context of the file handle. Context is a set of options that can modify the behavior of a stream.

Example below, rmdir() function is used to delete the specified directory.

Output : images directory is successfully created.

              images directory is successfully deleted.