PHPのis_readable()関数
定義と使用法
is_readable()関数をチェックし、指定されたファイルが読み取り可能なかどうか。
ファイルが読み取り可能である場合、この関数はTRUEを返します。
文法
is_readable(file)
参数 | 描述 |
---|---|
file | 必需。规定要检查的文件。 |
ヒントと注意事項
注意:この関数の結果はキャッシュされます。キャッシュをクリアするには、clearstatcache()を使用してください。
例
<?php
$file = "test.txt";
if(is_readable($file))
{
echo ("$file is readable");
}
else
{
echo ("$file is not readable");
}
?>
$file = "test.txt";
if(is_readable($file))
{
echo ("$file is readable");
}
else
{
echo ("$file is not readable");
}
?>
意志出力上のコード:
test.txt is readable
PHPファイルシステムリファレンスマニュアルを完了