PHP unlink() Funktion
❮ Referenz zum PHP-DateisystemBeispiel
Datei löschen:
<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
unlink("test.txt");
?>
Definition und Verwendung
Die Funktion unlink() löscht eine Datei.
Syntax
unlink(filename, context)
Parameterwerte
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 |
Technische Details
Rückgabewert: | TRUE bei Erfolg, FALSE bei Misserfolg |
---|---|
PHP-Version: | 4.0+ |
PHP-Änderungsprotokoll: | PHP 5.0 - Kontextparameter hinzugefügt |
❮ Referenz zum PHP-Dateisystem