The PHP rmdir() function removes an empty directory.

				
					<?php
rmdir('javascript');
?>
				
			

Output

				
					// removes "javascript" directory
				
			

Syntax

				
					rmdir(dir, context)
				
			

Parameters

ParameterDescription
dirSpecifies the path to the directory to be removed (required)
contextSpecifies the context of the file handle; context is a set of options that can modify the behavior of a stream