Definition :
The PHP is_readable() function checks whether a file exists and is readable.
Note: The results of this function are cached. Use clearstatcache() function to clear the cache.
is_readable(file)
Parameter | Description |
---|---|
file | Required. Specifies the path to the file to check |
Lets assume that we have a file called demo.txt in the current working directory. The example below demonstrates on using this function to check whether a file exists and is readable.
Output :demo.txt is readable