在线文档教程
PHP
SPL/Iterators

GlobIterator (class)

The GlobIterator class

Introduction

(PHP 5 >= 5.3.0, PHP 7)

Iterates through a file system in a similar fashion to glob().

Class synopsis

GlobIterator extends FilesystemIterator implements SeekableIterator , Countable {

/* Methods */

public __construct ( string $path [, int $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO ] )

public int count ( void )

/* Inherited methods */

public FilesystemIterator::__construct ( string $path [, int $flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS ] )

public mixed FilesystemIterator::current ( void )

public int FilesystemIterator::getFlags ( void )

public string FilesystemIterator::key ( void )

public void FilesystemIterator::next ( void )

public void FilesystemIterator::rewind ( void )

public void FilesystemIterator::setFlags ([ int $flags ] )

}

Table of Contents

  • GlobIterator::__construct — Construct a directory using glob

  • GlobIterator::count — Get the number of directories and files

← FilterIterator::valid

GlobIterator::__construct →

© 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

https://secure.php.net/manual/en/class.globiterator.php