W3Schools.com

PHP rmdir() Function


PHP Filesystem Reference Complete PHP Filesystem Reference

Definition and Usage

The rmdir() function removes an empty directory.

This function returns TRUE on success, or FALSE on failure.

Syntax

rmdir(dir,context)

Parameter Description
dir Required. Specifies the directory to be removed
context Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream


Example

<?php
$path = "images";
if(!rmdir($path))
  {
  echo ("Could not remove $path");
  }
?>


PHP Filesystem Reference Complete PHP Filesystem Reference
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE