(PHP 4, PHP 5, PHP 7)
Tells whether a file exists and is readable
bool is_readable ( string $filename )
Tells whether a file exists and is readable.
Parameters:
filename
Path to the file.
Returns:
Returns TRUE
if the file or directory specified by filename
exists and is readable, FALSE
otherwise.
Exception:
Upon failure, an E_WARNING
is emitted.
Notes:
The results of this function are cached. See clearstatcache() for more details.
The check is done using the real UID/GID instead of the effective one.
Examples:
is_readable() example
<?php $filename = 'test.txt'; if (is_readable($filename)) { echo 'The file is readable'; } else { echo 'The file is not readable'; } ?>
See also:
fgets() -
Please login to continue.