NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
# 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 ```