Get path of current Iterator item without filename in PHP

Description

The following code shows how to get path of current Iterator item without filename.

Example


/*from w w w.jav a2s.com*/
<?php
$iterator = new DirectoryIterator(dirname(__FILE__));
echo $iterator->getPath();
?>




















Home »
  PHP Tutorial »
    File »




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