Check whether the specified filename is readable:
<?php
$file = "test.txt";
if(is_readable($file)) {
echo ("$file is readable");
} else {
echo ("$file is not readable")
}
?>
The output of the code above could be:
test.txt is readable
The is_readable() function checks whether the specified filename is readable.
Note: The result of this function is cached. Use clearstatcache() to clear the cache.
is_readable(
file)
Parameter | Description |
---|---|
file | Required. Specifies the path to the file to check |
Return Value: | TRUE if the file is readable, FALSE and an E_WARNING otherwise |
---|---|
PHP Version: | 4.0+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!