Verify if the given filename can be read by checking:
<?php $file = “test.txt”; if(is_readable($file)) { echo (“$file is readable”); } else { echo (“$file is not readable”) } ?> |
The code above might produce is:
test.txt is readable |
The is_readable() method determines if the given filename can be read.
Note: This function caches its output. To clear the cache, use clearstatcache().
is_readable(file) |
Parameter |
Description |
file |
Essential. gives the location of the file to be checked. |
Return Value: |
If the file is readable, TRUE; if not, FALSE and an E_WARNING are displayed. |
PHP Version: |
4.0+ |