PHP unlink() 函数
2018-11-21 16:14 更新
PHP unlink() 函数

定义和用法
unlink() 函数删除文件。
如果成功,该函数返回 TRUE。如果失败,则返回 FALSE。
语法
unlink(filename,context)
参数 | 描述 |
---|---|
filename | 必需。规定要删除的文件。 |
context | 可选。规定文件句柄的环境。context 是一套可以修改流的行为的选项。 |
实例
<?php
$file = "test.txt";
if (!unlink($file))
{
echo ("Error deleting $file");
}
else
{
echo ("Deleted $file");
}
?>
$file = "test.txt";
if (!unlink($file))
{
echo ("Error deleting $file");
}
else
{
echo ("Deleted $file");
}
?>

以上内容是否对您有帮助:
更多建议: