unlink
Delete files
unlink() function deletes the file.
If successful, return true, and if failed, false.
<?php
$file = "test.txt";
if (!unlink($file))
{
echo ("Error deleting $file");
}
else
{
echo ("Deleted $file");
}
?>
unlink ( filename , context )
| parameter | describe |
|---|---|
| filename | Required. Specify the files to be deleted. |
| context | Optional. Specifies the environment for file handles. Context is a set of options that can modify the behavior of a stream. |