Get path and file name of current DirectoryIterator item in PHP

Description

The following code shows how to get path and file name of current DirectoryIterator item.

Example


/*  ww w  . ja va  2  s.co m*/
<?php
$iterator = new DirectoryIterator(dirname(__FILE__));
foreach ($iterator as $fileinfo) {
    echo $fileinfo->getPathname() . "\n";
}
?>




















Home »
  PHP Tutorial »
    File »




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