Hàm PHP rmdir()
❮ Tham khảo hệ thống tập tin PHPVí dụ
Xóa thư mục "hình ảnh":
<?php
$path = "images";
if(!rmdir($path)) {
echo ("Could not remove $path");
}
?>
Định nghĩa và cách sử dụng
Hàm rmdir() loại bỏ một thư mục trống.
Cú pháp
rmdir( dir , context )
Giá trị tham số
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 |
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