說明
bool
is_readable ( string filename )
若果由 filename
特殊的檔案或目錄存在並且可讀則返回 TRUE。
記住 PHP 也許只能以運行 webserver 的會員名(通常為
'nobody')來訪問檔案。不計入安全模式的限制。
例子 1. is_readable() 例子
<?php $filename = 'test.txt'; if (is_readable($filename)) { echo 'The file is readable'; } else { echo 'The file is not readable'; } ?>
|
|
提示: 自 PHP 5.0.0
起本函數也可被某些 URL wrapper 使用。參考附錄 M 來看哪些 wrapper 支援
stat() 系列函數的功能。
參見 is_writable(),file_exists()
和 fgets()。