Create a new filesystem iterator in PHP

Description

The following code shows how to create a new filesystem iterator.

Example


<?php/*from www . j a  v  a2s.  c o  m*/
$it = new FilesystemIterator(dirname(__FILE__));
foreach ($it as $fileinfo) {
    echo $fileinfo->getFilename() . "\n";
}
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    File »




Directory
DirectoryIterator
Drive
File
File Permission
File Read Save
FileSystemIterator
Path
Zip