PHP is_readable() 函數
完整的 PHP Filesystem 參考手冊
定義和用法
is_readable() 函數檢查指定的文件是否可讀。
如果文件可讀,該函數返回 TRUE。
語法
提示和注釋
注釋:該函數的結果會被緩存。請使用 clearstatcache() 來清除緩存。
實例
<?php
$file = "test.txt";
if(is_readable($file))
{
echo ("$file is readable");
}
else
{
echo ("$file is not readable");
}
?>
上面的代碼將輸出:
完整的 PHP Filesystem 參考手冊