多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 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 ```