Funkce PHP unlink() .
❮ Reference souborového systému PHPPříklad
Smazat soubor:
<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
unlink("test.txt");
?>
Definice a použití
Funkce unlink() odstraní soubor.
Syntax
unlink(filename, context)
Hodnoty parametrů
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 |
Technické údaje
Návratová hodnota: | PRAVDA při úspěchu, NEPRAVDA při neúspěchu |
---|---|
Verze PHP: | 4,0+ |
PHP Changelog: | PHP 5.0 - Přidán parametr kontextu |
❮ Reference souborového systému PHP