Monday, 30 September 2013

iterator_apply - Call a function for every element in an iterator - PHP

int iterator_apply ( Traversable $iterator , callable $function [, array $args ] )
Call a function for every element in an iterator
Calls a function for every element in an iterator.

<?php

function print_caps(Iterator $iterator) {
    echo 
strtoupper($iterator->current()) . "\n";
    return 
TRUE;
}
$it = new ArrayIterator(array("Apples""Bananas""Cherries"));iterator_apply($it"print_caps", array($it));?>


The iterator_apply Function in PHP

2 comments :

AUSTERO said...

REALLY VERY EXCELLENT INFORMATION. I AM VERY GLAD TO SEE YOUR BLOG FOR THIS INFORMATION. THANKS FOR SHARING. KEEP UPDATING.

NO.1 AQM Services | Application Quality Managment Services | Austere Technologies

massil said...

Very good informative article. Thanks for sharing such nice article, keep on up dating such good articles.

BEST MOBILE APPLICATION DEVELOPMENT SERVICES | MASSIL TECHNOLOGIES

Post a Comment