ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# PHP is_readable() 函数 ## 定义和用法 is_readable() 函数判断指定文件名是否可读。 ### 语法 ``` is_readable(file) ``` | 参数 | 描述 | | --- | --- | | file | 必需。规定要检查的文件。 | ### 说明 如果由 _file_ 指定的文件或目录存在并且可读,则返回 TRUE。 ## 提示和注释 注释:本函数的结果会被缓存。请使用 [clearstatcache()](/php/func_filesystem_clearstatcache.asp "PHP clearstatcache() 函数") 来清除缓存。 ## 例子 ``` <?php $file = "test.txt"; if(is_readable($file)) { echo ("$file is readable"); } else { echo ("$file is not readable"); } ?> ``` 输出: ``` test.txt is readable ```