CallbackFilterIterator::__construct

(PHP 5 >= 5.4.0, PHP 7)

CallbackFilterIterator::__constructCreate a filtered iterator from another iterator

说明

public CallbackFilterIterator::__construct ( Iterator $iterator , callable $callback )

Creates a filtered iterator using the callback to determine which items are accepted or rejected.

参数

iterator

The iterator to be filtered.

callback

The callback, which should return TRUE to accept the current item or FALSE otherwise. See Examples.

May be any valid callable value.

返回值

没有返回值。

参见

相关文章
php arrayobject create a new iterator from an arrayobject instancephp callbackfilteriterator calls the callback with the current value the current key and the inner iterator as argumentsphp callbackfilteriterator create a filtered iterator from another iteratorphp directoryiterator constructs a new directory iterator from a pathphp map creates a new map using values from the current instance and another mapphp eventbufferevent create a new ssl buffer event to send its data over another buffer eventphp runkit 函数 copies a method from class to anotherphp socket 函数 create and bind to a socket from a given addrinfophp socket 函数 create and connect to a socket from a given addrinfophp ssdeep 函数 create a fuzzy hash from a filephp intlbreakiterator create break iterator for boundaries of combining character sequencesphp intlbreakiterator create iterator for navigating fragments between boundariesphp intlcalendar create an intlcalendar from a datetime object or stringphp intlrulebasedbreakiterator create iterator from rulesetphp iteratoriterator create an iterator from anything that is traversablephp oci collection assigns a value to the collection from another existing collectionphp phardata construct a tar or zip archive from an iteratorphp recursivefilteriterator create a recursivefilteriterator from a recursiveiteratorphp splobjectstorage adds all objects from another storagephp splobjectstorage removes all objects except for those contained in another storage from the current storage
关注编程学问公众号