DirectoryIterator::isReadable

(PHP 5, PHP 7)

DirectoryIterator::isReadableDetermine if current DirectoryIterator item can be read

说明

public DirectoryIterator::isReadable ( void ) : bool

Determines if the current DirectoryIterator item is readable.

参数

此函数没有参数。

返回值

Returns TRUE if the file is readable, otherwise FALSE

范例

Example #1 DirectoryIterator::isReadable() example

<?php
$iterator 
= new DirectoryIterator(dirname(__FILE__));
foreach (
$iterator as $fileinfo) {
    if (
$fileinfo->isReadable()) {
        echo 
$fileinfo->getFilename() . "\n";
    }
}
?>

以上例程的输出类似于:

apple.jpg
banana.jpg
example.php
pears.jpg

参见

相关文章
php directoryiterator return the current directoryiterator itemphp directoryiterator get last access time of the current directoryiterator itemphp directoryiterator get base name of current directoryiterator itemphp directoryiterator get inode change time of the current directoryiterator itemphp directoryiterator return file name of current directoryiterator itemphp directoryiterator get group for the current directoryiterator itemphp directoryiterator determine the type of the current directoryiterator itemphp directoryiterator determine if current directoryiterator item is a directoryphp directoryiterator determine if current directoryiterator item is . or .. php directoryiterator determine if current directoryiterator item is executablephp directoryiterator determine if current directoryiterator item is a regular filephp directoryiterator determine if current directoryiterator item is a symbolic linkphp directoryiterator determine if current directoryiterator item can be readphp directoryiterator determine if current directoryiterator item can be written tophp directoryiterator return the key for the current directoryiterator itemphp runkit 函数 determines if the current functions return value will be usedphp phar returns true if the phar archive can be modifiedphp phardata returns true if the tar/zip archive can be modifiedphp recursiveiterator returns if an iterator can be created for the current entryphp zookeeper checks if the current zookeeper connection state can be recovered
关注编程学问公众号