PHP - unlink
Trieda
Metóda - unlink
(PHP 4, PHP 5, PHP 7)
The unlink() function removes a file. A E_WARNING
level warning is emitted in case of failure.
Procedurálne
- function unlink (string $filename) : bool
Parametre
| Názov | Dátový typ | Predvolená hodnota | Popis |
|---|---|---|---|
| $filename | string | The path to the file. |
Mávratovej hodnoty
Vracia: bool
Returns true on success or false on failure.
Príklady
<?php
$filepath = "file.txt";
if (unlink($filepath)) {
echo "File successfully removed.";
}
else{
echo "Error removing file.";
}
