Hàm mkdir() của PHP
❮ Tham khảo hệ thống tập tin PHPVí 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ả về: | ĐÚNG nếu thành công, SAI nếu thất bại |
---|---|
Phiên bản PHP: | 4.0+ |
❮ Tham khảo hệ thống tập tin PHP