PHP rmdir()関数
❮PHPファイルシステムリファレンス例
「画像」ディレクトリを削除します。
<?php
$path = "images";
if(!rmdir($path)) {
echo ("Could not remove $path");
}
?>
定義と使用法
rmdir()関数は、空のディレクトリを削除します。
構文
rmdir(dir, context)
パラメータ値
Parameter | Description |
---|---|
dir | Required. Specifies the path to 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 |
技術的な詳細
戻り値: | 成功した場合はTRUE、失敗した場合はFALSE |
---|---|
PHPバージョン: | 4.0以降 |
❮PHPファイルシステムリファレンス