Search Results

  1. Examples ¶ Example #1 DirectoryIterator::next () example List the contents of a directory using a while loop.

  2. Examples Example #1 DirectoryIterator::next () example List the contents of a directory using a while loop.

  3. Nov 26, 2019 · The DirectoryIterator::next () function is an inbuilt function in PHP which is used to move forward to the next DirectoryIterator item. Syntax: void DirectoryIterator::next( void ) Parameters: This function does not accept any parameters. Return Value: This function does not return any value.

  4. See Also DirectoryIterator::current () - Return the current DirectoryIterator item DirectoryIterator::key () - Return the key for the current DirectoryIterator item DirectoryIterator::rewind () - Rewind the DirectoryIterator back to the start DirectoryIterator::valid () - Check whether current DirectoryIterator position is a valid file Iterator::next () - Move forward to next element <?php ...

  5. DirectoryIterator::key () - Return the key for the current DirectoryIterator item DirectoryIterator::rewind () - Rewind the DirectoryIterator back to the start DirectoryIterator::valid () - Check whether current DirectoryIterator position is a valid file Iterator::next () - Move forward to next element

  6. DirectoryIterator::next (PHP 5, PHP 7) DirectoryIterator::next — Move forward to next DirectoryIterator item Description public DirectoryIterator::next ( ) : void Move forward to the next DirectoryIterator item. Parameters This function has no parameters. Return Values No value is returned. Examples Example #1 DirectoryIterator::next() example List the contents of a directory using a while ...

  7. 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.