php man page for limititerator

Query: limititerator

OS: php

Section: 3

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

LIMITITERATOR(3)							 1							  LIMITITERATOR(3)

The LimitIterator class

INTRODUCTION
The LimitIterator class allows iteration over a limited subset of items in an Iterator.
CLASS SYNOPSIS
LimitIterator LimitIteratorextends IteratorIteratorOuterIterator Methods o public LimitIterator::__construct (Iterator $iterator, [int $offset], [int $count = -1]) o public mixed LimitIterator::current (void ) o public Iterator LimitIterator::getInnerIterator (void ) o public int LimitIterator::getPosition (void ) o public mixed LimitIterator::key (void ) o public void LimitIterator::next (void ) o public void LimitIterator::rewind (void ) o public int LimitIterator::seek (int $position) o public bool LimitIterator::valid (void )
EXAMPLES
Example #1 LimitIterator usage example <?php // Create an iterator to be limited $fruits = new ArrayIterator(array( 'apple', 'banana', 'cherry', 'damson', 'elderberry' )); // Loop over first three fruits only foreach (new LimitIterator($fruits, 0, 3) as $fruit) { var_dump($fruit); } echo " "; // Loop from third fruit until the end // Note: offset starts from zero for apple foreach (new LimitIterator($fruits, 2) as $fruit) { var_dump($fruit); } ?> The above example will output: string(5) "apple" string(6) "banana" string(6) "cherry" string(6) "cherry" string(6) "damson" string(10) "elderberry" PHP Documentation Group LIMITITERATOR(3)
Related Man Pages
recursivecachingiterator(3) - php
directoryiterator(3) - php
recursivearrayiterator(3) - php
spldoublylinkedlist(3) - php
spltempfileobject(3) - php
Similar Topics in the Unix Linux Community
display and output...question
Getting Distinct values from second field in a file....
Urgent! need help! how to convert this file into comma delimited format
How to split file based on subtitle
Searching for values in a file