php man page for iterator_apply

Query: iterator_apply

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

ITERATOR_APPLY(3)							 1							 ITERATOR_APPLY(3)

iterator_apply - Call a function for every element in an iterator

SYNOPSIS
int iterator_apply (Traversable $iterator, callable $function, [array $args])
DESCRIPTION
Calls a function for every element in an iterator.
PARAMETERS
o $iterator - The class to iterate over. o $function - The callback function to call on every element. Note The function must return TRUE in order to continue iterating over the $iterator. o $args - Arguments to pass to the callback function.
RETURN VALUES
Returns the iteration count.
EXAMPLES
Example #1 iterator_apply(3) example <?php function print_caps(Iterator $iterator) { echo strtoupper($iterator->current()) . " "; return TRUE; } $it = new ArrayIterator(array("Apples", "Bananas", "Cherries")); iterator_apply($it, "print_caps", array($it)); ?> The above example will output: APPLES BANANAS CHERRIES
SEE ALSO
array_walk(3). PHP Documentation Group ITERATOR_APPLY(3)
Related Man Pages
callbackfilteriterator(3) - php
recursivearrayiterator(3) - php
rdf::trine::iterator::bindings::materialized(3pm) - debian
rdf::trine::iterator::graph::materialized(3pm) - debian
tap::parser::iterator::array(3pm) - suse
Similar Topics in the Unix Linux Community
Coming Soon: Upgrade Forum Software (Dec 31 - Jan 1)
New Code Tags (Syntax Highlighting)
The Order of the Wizard's Hat - Lifetime Achievement Award 2019 - Congrats to Don Cragun
The Order of the Wizard's Hat - Lifetime Achievement Award 2019 - Congrats to Wolf Machowitsch
Denial Of Service Attack Update