Search Results

  1. Changelog ¶ ... Examples ¶ Example #1 A DirectoryIterator::__construct () example This example will list the contents of the directory containing the script.

    • PHP

      The DirectoryIterator class Introduction ¶ The...

    • Isdot

      Examples ¶ Example #1 A DirectoryIterator::isDot () example...

    • Getextension

      DirectoryIterator::getExtension (PHP 5 >= 5.3.6, PHP 7,...

    • Key

      Return the key for the current DirectoryIterator item

    • Getfilename

      Examples ¶ Example #1 A DirectoryIterator::getFilename ()...

    • Getbasename

      Examples ¶ Example #1 A DirectoryIterator::getBasename ()...

    • Valid

      DirectoryIterator::valid (PHP 5, PHP 7, PHP 8)...

    • Rewind

      Rewind the DirectoryIterator back to the start

  2. Mar 27, 2023 · The DirectoryIterator::__construct () function is an inbuilt function in PHP which is used to construct a new directory iterator from a path. Syntax: public DirectoryIterator::__construct( string $path ) Parameters: This function accepts single parameter $path which holds the path of the directory to traverse.

  3. Comparing generators with Iterator objects Comparison of floating point numbers Constants Constructors and Destructors Covariance and Contravariance Declaring Attribute Classes Declaring sub-namespaces

  4. Sep 24, 2025 · Methods of DirectoryIterator Class DirectoryIterator is a class in the Standard PHP Library that provides several useful methods, including: getFilename () → Returns the name of the file or directory. getExtension () → Returns the file extension. isFile () / isDir () → Checks whether the item is a file or a directory.

  5. (PHP 5, PHP 7) The DirectoryIterator class Introduction (PHP 5, PHP 7) The DirectoryIterator class provides a simple interface for viewing the contents of filesystem directories. Class synopsis

  6. Please be careful in case you are looking for filenames in that directory because DirectoryIterator will return a very special symbolic filenames: . and .. You must do a check to ignore them before dealing with real file names.

  7. php operating system manual for directoryiterator section 3 of the unix.com man page documentation.