PHP mkdir()関数
❮PHPファイルシステムリファレンス例
「test」という名前のディレクトリを作成します。
<?php
mkdir("test");
?>
定義と使用法
mkdir()関数は、パス名で指定されたディレクトリを作成します。
構文
mkdir(path, mode, recursive, context)
パラメータ値
Parameter | Description |
---|---|
path | Required. Specifies the directory path to create |
mode | Optional. Specifies permissions. By default, the mode is 0777 (widest possible access). Note: The mode parameters is ignored on Windows platforms! The mode parameter consists of four numbers:
Possible values (to set multiple permissions, add up the following numbers):
|
recursive | Optional. Specifies if the recursive mode is set (added in PHP 5) |
context | Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream (added in PHP 5) |
技術的な詳細
戻り値: | 成功した場合はTRUE、失敗した場合はFALSE |
---|---|
PHPバージョン: | 4.0以降 |
❮PHPファイルシステムリファレンス