PHP unlink()ฟังก์ชั่น
❮ การอ้างอิงระบบไฟล์ PHPตัวอย่าง
ลบไฟล์:
<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
unlink("test.txt");
?>
ความหมายและการใช้งาน
ฟังก์ชัน unlink() ลบไฟล์
ไวยากรณ์
unlink(filename, context)
ค่าพารามิเตอร์
Parameter | Description |
---|---|
filename | Required. Specifies the path to the file to delete |
context | Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream |
รายละเอียดทางเทคนิค
คืนมูลค่า: | จริงกับความสำเร็จ เท็จเมื่อล้มเหลว |
---|---|
รุ่น PHP: | 4.0+ |
บันทึกการเปลี่ยนแปลง PHP: | PHP 5.0 - เพิ่มพารามิเตอร์บริบท |
❮ การอ้างอิงระบบไฟล์ PHP