The DirectoryIterator class
(PHP 5, PHP 7, PHP 8)
Introduction
The DirectoryIterator class provides a simple interface for viewing the contents of filesystem directories.
Class synopsis
/* Methods */
/* Inherited methods */
public function SplFileInfo::openFile(string
}$mode = "r", bool $useIncludePath = false, ?resource $context = null): SplFileObjectTable of Contents
- DirectoryIterator::__construct — Constructs a new directory iterator from a path
- DirectoryIterator::current — Return the current DirectoryIterator item
- DirectoryIterator::getBasename — Get base name of current DirectoryIterator item
- DirectoryIterator::getExtension — Gets the file extension
- DirectoryIterator::getFilename — Return file name of current DirectoryIterator item
- DirectoryIterator::isDot — Determine if current DirectoryIterator item is '.' or '..'
- DirectoryIterator::key — Return the key for the current DirectoryIterator item
- DirectoryIterator::next — Move forward to next DirectoryIterator item
- DirectoryIterator::rewind — Rewind the DirectoryIterator back to the start
- DirectoryIterator::seek — Seek to a DirectoryIterator item
- DirectoryIterator::__toString — Get file name as a string
- DirectoryIterator::valid — Check whether current DirectoryIterator position is a valid file
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
