Hàm rmdir () trong PHP
❮ Tham chiếu hệ thống tệp PHPThí 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ả 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