W3cubDocs

/PHP

The RecursiveDirectoryIterator class

Introduction

(PHP 5, PHP 7)

The RecursiveDirectoryIterator provides an interface for iterating recursively over filesystem directories.

Class synopsis

RecursiveDirectoryIterator extends FilesystemIterator implements SeekableIterator , RecursiveIterator {
/* Inherited constants */
const int FilesystemIterator::SKIP_DOTS = 4096 ;
const int FilesystemIterator::UNIX_PATHS = 8192 ;
/* Methods */
public __construct ( string $path [, int $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO ] )
public getChildren ( ) : mixed
public getSubPath ( ) : string
public getSubPathname ( ) : string
public hasChildren ([ bool $allow_links = false ] ) : bool
public key ( ) : string
public next ( ) : void
public rewind ( ) : void
/* Inherits */
public FilesystemIterator::__construct ( string $path [, int $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS ] )
public FilesystemIterator::current ( ) : mixed
public FilesystemIterator::getFlags ( ) : int
public FilesystemIterator::key ( ) : string
public FilesystemIterator::next ( ) : void
public FilesystemIterator::rewind ( ) : void
public FilesystemIterator::setFlags ([ int $flags ] ) : void
}

Changelog

Version Description
5.3.0 The FilesystemIterator was introduced as the parent class. Previously, the parent was the DirectoryIterator.
5.3.0 Implements SeekableIterator.
5.2.11, 5.3.1 Added RecursiveDirectoryIterator::FOLLOW_SYMLINKS

Table of Contents

© 1997–2020 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/class.recursivedirectoryiterator.php