LimitIterator
PHP Manual

LimitIterator::__construct

(PHP 5 >= 5.1.0)

LimitIterator::__constructساخت LimitIterator

Description

LimitIterator::__construct ( Iterator $iterator [, int $offset = 0 [, int $count = -1 ]] )

ساخت LimitIterator از iterator به همراه offset شروع داده شده و بیشترین count.

Parameters

iterator

Iterator برای جد.

offset

آفست اختیاری حد.

count

شمارش اختیاری حد.

Return Values

LimitIterator جدید.

Errors/Exceptions

ایجاد OutOfRangeException اگر offset کمتر از 0 باشد یا count کمتر از -1 بتشپ.

Examples

Example #1 مثال LimitIterator::__construct()

<?php
$ait 
= new ArrayIterator(array('a''b''c''d''e'));
$lit = new LimitIterator($ait13);
foreach (
$lit as $value) {
    echo 
$value "\n";
}
?>

The above example will output:

b
c
d

See Also


LimitIterator
PHP Manual