Hàm mkdir () trong PHP
❮ Tham chiếu hệ thống tệp PHPThí dụ
Tạo một thư mục có tên "test":
<?php
mkdir("test");
?>
Định nghĩa và Cách sử dụng
Hàm mkdir () tạo một thư mục được chỉ định bởi tên đường dẫn.
Cú pháp
mkdir(path, mode, recursive, context)
Giá trị tham số
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) |
Chi tiết kỹ thuật
Giá trị trả lại: | ĐÚNG về thành công, SAI về thất bại |
---|---|
Phiên bản PHP: | 4.0+ |
❮ Tham chiếu hệ thống tệp PHP