The is_readable() function checks whether the specified file is readable.
If the file is readable, this function returns TRUE.
is_readable(file)
| parameter | describe |
|---|---|
| file | Required. Specifies the documents to be checked. |
Note: The results of this function will be cached. Please use clearstatcache() to clear the cache.
<?php$file = "test.txt";if(is_readable($file)) { echo ("$file is readable"); }else { echo ("$file is not readable"); }?>The above code will output:
test.txt is readable