Returns whether a file is readable.
This function returns TRUE if PHP has read access to a specified file and FALSE if it does not. If the file does not exist FALSE is also returned.
<?php
$filename = "log.txt";
if (is_readable($filename)) {
print "File is readable";
$logfile = fopen($filename, "r");
} else {
print "Access denied to $filename";
}
?>File is readableIf the file does not exist, or user privileges of PHP do not permit reading of the file, the file cannot be opened.