is_readable
判断给定文件名是否可读
&reftitle.description;
boolis_readable
stringfilename
判断给定文件名是否存在并且可读。
&reftitle.parameters;
filename
文件的路径。
&reftitle.returnvalues;
如果由 filename
指定的文件或目录存在并且可读则返回 &true;,否则返回 &false;。
&reftitle.errors;
&fs.emits.warning.on.failure;
&reftitle.examples;
is_readable 例子
]]>
&reftitle.notes;
记住 PHP 也许只能以运行 webserver 的用户名(通常为
'nobody')来访问文件。不计入安全模式的限制。
¬e.clearstatcache;
&tip.fopen-wrapper.stat;
The check is done using the real UID/GID instead of the effective one.
对于目录这个函数可能会返回 &true;。请使用 is_dir 来区分文件和目录。
&reftitle.seealso;
is_writable
file_exists
fgets