在线文档教程
PHP
SPL/Iterators

FilterIterator (class)

The FilterIterator class

Introduction

(PHP 5 >= 5.1.0, PHP 7)

This abstract iterator filters out unwanted values. This class should be extended to implement custom iterator filters. The FilterIterator::accept() must be implemented in the subclass.

Class synopsis

abstract FilterIterator extends IteratorIterator implements OuterIterator {

/* Methods */

public abstract bool accept ( void )

public __construct ( Iterator $iterator )

public mixed current ( void )

public Iterator getInnerIterator ( void )

public mixed key ( void )

public void next ( void )

public void rewind ( void )

public bool valid ( void )

}

Table of Contents

  • FilterIterator::accept — Check whether the current element of the iterator is acceptable

  • FilterIterator::__construct — Construct a filterIterator

  • FilterIterator::current — Get the current element value

  • FilterIterator::getInnerIterator — Get the inner iterator

  • FilterIterator::key — Get the current key

  • FilterIterator::rewind — Rewind the iterator

  • FilterIterator::valid — Check whether the current element is valid

← FilesystemIterator::setFlags

FilterIterator::accept →

© 1997–2017 The PHP Documentation Group

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

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