Check the type of the current DirectoryIterator item in PHP
Description
The following code shows how to check the type of the current DirectoryIterator item.
Example
//from ww w. j a v a 2 s . c o m
<?php
$iterator = new DirectoryIterator(dirname(__FILE__));
foreach ($iterator as $fileinfo) {
echo $fileinfo->getFilename() . " " . $fileinfo->getType() . "\n";
}
?>
The code above generates the following result.