September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool is_readable(string filename) Checks whether a file is readable.
Returns:
TRUE if readable; FALSE otherwise
Description:
Checks whether the specified file is readable by PHP. Note that depending on how the script is executed (command line, CGI, module), the test may be performed with varying user IDs, so permissions may affect the result of the function. Safe mode restrictions are not taken into account.
Note:
The results of this function are cached. See clearstatcache() for details.
Example:
$file = "testfile";
if(is_readable($file))
{
// open and read from file
}
else
{
echo ("Cannot read from file $file.");
}
|
Read now
Unlock full access