|
The RecursiveCallbackFilterIterator classIntroduction
Class synopsis
RecursiveCallbackFilterIterator
extends
CallbackFilterIterator
implements
RecursiveIterator
/* Methods */
public RecursiveCallbackFilterIterator::__construct(RecursiveIterator
$iterator , callable $callback )public RecursiveCallbackFilterIterator RecursiveCallbackFilterIterator::getChildren()
public bool RecursiveCallbackFilterIterator::hasChildren()
/* Inherited methods */
public bool accept()
public bool FilterIterator::accept()
public mixed FilterIterator::current()
public mixed FilterIterator::key()
public void FilterIterator::next()
public void FilterIterator::rewind()
public bool FilterIterator::valid()
public mixed IteratorIterator::current()
public Iteratornull IteratorIterator::getInnerIterator()
public mixed IteratorIterator::key()
public void IteratorIterator::next()
public void IteratorIterator::rewind()
public bool IteratorIterator::valid()
ExamplesThe callback should accept up to three arguments: the current item, the current key and the iterator, respectively. Example #1 Available callback arguments
Filtering a recursive iterator generally involves two conditions.
The first is that, to allow recursion, the callback function should return Example #2 Recursive callback basic example
|