Check if current DirectoryIterator item can be written to in PHP
Description
The following code shows how to check if current DirectoryIterator item can be written to.
Example
/*from w w w . j a v a2s. com*/
//This example lists the files and directories which can be
//opened for writing in the directory containing the script.
<?php
$iterator = new DirectoryIterator(dirname(__FILE__));
foreach ($iterator as $fileinfo) {
if ($fileinfo->isWritable()) {
echo $fileinfo->getFilename() . "\n";
}
}
?>
The code above generates the following result.