PHP is_writeable()関数
完全な PHP Filesystem リファレンスマニュアル
定義と使い方
is_writeable() 関数は、指定されたファイルが書き込み可能かどうかをチェックします。
ファイルが書き込み可能な場合、この関数は TRUE を返します。
この関数は is_writable() 関数のエイリアスです。
構文
is_writeable(file)
| パラメータ | 説明 |
|---|---|
| file | 必須。チェックするファイルを指定します。 |
ヒントと注記
注記:この関数の結果はキャッシュされます。キャッシュをクリアするには clearstatcache() を使用してください。
例
<?php
$file = "test.txt";
if(is_writeable($file))
{
echo ("$file is writeable");
}
else
{
echo ("$file is not writeable");
}
?>
$file = "test.txt";
if(is_writeable($file))
{
echo ("$file is writeable");
}
else
{
echo ("$file is not writeable");
}
?>
上記のコードは次のように出力されます:
test.txt is writeable
完全な PHP Filesystem リファレンスマニュアル その他の拡張