PHP batalkan tautan () Fungsi
Referensi Sistem File PHPContoh
Hapus file:
<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
unlink("test.txt");
?>
Definisi dan Penggunaan
Fungsi unlink() menghapus file.
Sintaksis
unlink(filename, context)
Nilai Parameter
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 |
Detail Teknis
Nilai Kembali: | BENAR pada keberhasilan, SALAH pada kegagalan |
---|---|
Versi PHP: | 4.0+ |
Log Perubahan PHP: | PHP 5.0 - Menambahkan parameter konteks |
Referensi Sistem File PHP