Php/func filesystem is readable
来自菜鸟教程
PHP is_visible()函数
例
检查指定的文件名是否可读:
<?php
$file = "test.txt";
if(is_readable($file)) {
echo ("$file is readable");
} else {
echo ("$file is not readable")
}
?>
上面代码的输出可能是:
test.txt is readable
定义和用法
is_visible()函数检查指定的文件名是否可读。
注意: 此功能的结果被缓存。Use clearstatcache()
清除缓存。
句法
is_readable(file)
参数值
| 参数 | 描述 |
|---|---|
| file | 需要。指定要检查的文件的路径 |
技术细节
| 返回值: | 如果文件可读,则为TRUE,否则为FALSE和E_WARNING |
| PHP版本: | 4.0+ |