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
recursivearrayiterator(3) - php
recursivecallbackfilteriterator(3) - php
net::cli::interact::role::iterator(3pm) - debian
rdf::trine::iterator::graph::materialized(3pm) - debian
imagick.setiteratorindex(3) - php
Similar Topics in the Unix Linux Community
Rules for Homework &amp; Coursework Questions Forum
Coming Soon: Upgrade Forum Software (Dec 31 - Jan 1)
New Code Tags (Syntax Highlighting)
Status of UNIX.COM Forum Transformation
Denial Of Service Attack Update