(PHP 5 >= 5.1.2, PHP 7, PHP 8)
SplFileInfo::isReadable — Tells if file is readable
Check if the file is readable.
此函数没有参数。
Returns true
if readable, false
otherwise.
示例 #1 SplFileInfo::isReadable() example
<?php
$info = new SplFileInfo('readable.jpg');
if ($info->isReadable()) {
echo $info->getFilename() . ' is readable';
}
?>
以上示例的输出类似于:
readable.jpg is readable