Table of Contents

rmdir

WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0

Remove a directory, with optional deletion of contents

Description

int rmdir ( string $pathname [, int $delete_contents ] )

This function attempts to remove a directory as specified by the pathname

Parameters

$pathname: The directory path. Using a / at the beginning will make it relative to the root, otherwise it will be relative to the current working directory, which is either the folder that the script was started in or as was set by chdir().

$delete_contents: Optional

Return Values

Integer: 0 on success or -1 on failure

Example

<?
  if (rmdir("/mypath/")==0) print("Directory removed!");
?>

See Also

chdir() - Change the current directory

getcwd() - Get the current directory

mkdir() - Make a directory

unlink() - Remove a file (delete it)