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 ```