创建一个名为"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+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!