Usage of is_readable function in php: [is_readable(file)]. The is_readable function is used to determine whether the specified file is readable. If the specified file or directory exists and is readable, the function returns true, otherwise, the function returns false.
php is_readable function is used to determine whether the specified file is readable. Its syntax is is_readable(file). The parameter file is required and refers to the file to be checked. .
(Recommended tutorial: php video tutorial)
How to use the php is_readable function?
Function: Determine whether the specified file is Readable.
Syntax:
is_readable(file)
Parameters:
file required. Specifies the documents to be checked.
Explanation:
Returns TRUE if the file or directory specified by file exists and is readable.
php is_readable() function example
<?php $file = is_readable("./test.txt"); if($file == 1) { echo "该文件是可读的"; }else{ echo "该文件不可读"; } ?>
The above is the detailed content of How to use the is_readable function in php. For more information, please follow other related articles on the PHP Chinese website!