Current Location: Home> Function Categories> unlink

unlink

Delete files
Name:unlink
Category:File system
Programming Language:php
One-line Description:Delete the file.

Definition and usage

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");
  }
?>

grammar

 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.
Similar Functions
Popular Articles