PHP unlink() Functie
❮ Referentie voor PHP-bestandssysteemVoorbeeld
Een bestand verwijderen:
<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
unlink("test.txt");
?>
Definitie en gebruik
De functie unlink() verwijdert een bestand.
Syntaxis
unlink(filename, context)
Parameterwaarden
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
Winstwaarde: | WAAR bij succes, ONWAAR bij mislukking |
---|---|
PHP-versie: | 4.0+ |
PHP-wijzigingslogboek: | PHP 5.0 - De contextparameter toegevoegd |
❮ Referentie voor PHP-bestandssysteem