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
limititerator(3) - php
recursivearrayiterator(3) - php
net::cli::interact::role::iterator(3pm) - debian
rdf::trine::iterator::bindings::materialized(3pm) - debian
Similar Topics in the Unix Linux Community
UNIX.COM 2017 Year End Summary
New Code Tags (Syntax Highlighting)
Status of UNIX.COM Forum Transformation
Please Welcome Ravinder Singh to the Moderation Team
The Order of the Wizard's Hat - Lifetime Achievement Award 2019 - Congrats to Don Cragun