Check if current DirectoryIterator item can be read in PHP
Description
The following code shows how to check if current DirectoryIterator item can be read.
Example
<?php/* ww w. j av a 2 s .co m*/
$iterator = new DirectoryIterator(dirname(__FILE__));
foreach ($iterator as $fileinfo) {
if ($fileinfo->isReadable()) {
echo $fileinfo->getFilename() . "\n";
}
}
?>
The code above generates the following result.