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

锟轿硷拷