PHP unlink()関数
❮PHPファイルシステムリファレンス例
ファイルを削除します。
<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
unlink("test.txt");
?>
定義と使用法
unlink()関数はファイルを削除します。
構文
unlink(filename, context)
パラメータ値
Parameter | Description |
---|---|
filename | Required. Specifies the path to the file to delete |
context | Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream |
技術的な詳細
戻り値: | 成功した場合はTRUE、失敗した場合はFALSE |
---|---|
PHPバージョン: | 4.0以降 |
PHP変更ログ: | PHP5.0-コンテキストパラメータを追加しました |
❮PHPファイルシステムリファレンス