Funkcja unlink() PHP
❮ Dokumentacja systemu plików PHPPrzykład
Usuń plik:
<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
unlink("test.txt");
?>
Definicja i użycie
Funkcja unlink() usuwa plik.
Składnia
unlink(filename, context)
Wartości parametrów
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 |
Szczegóły techniczne
Wartość zwrotu: | TRUE w przypadku sukcesu, FALSE w przypadku porażki |
---|---|
Wersja PHP: | 4.0+ |
Dziennik zmian PHP: | PHP 5.0 - Dodano parametr context |
❮ Dokumentacja systemu plików PHP