The unlink() function deletes files.
If successful, the function returns TRUE. If it fails, returns FALSE.
unlink(filename,context)
parameter | describe |
---|---|
filename | Required. Specifies the files to be deleted. |
context | Optional. Specifies the environment for a file handle. context is a set of options that can modify the behavior of the stream. |
<?php$file = "test.txt";if (!unlink($file)) { echo ("Error deleting $file"); }else { echo ("Deleted $file"); }?>