php教程

AppendIterator::append

(PHP 5 >= 5.1.0, PHP 7)

AppendIterator::appendAppends an iterator

说明

public AppendIterator::append ( Iterator $iterator ) : void

Appends an iterator.

参数

iterator

The iterator to append.

返回值

没有返回值。

范例

Example #1 AppendIterator::append() example

<?php
$array_a 
= new ArrayIterator(array('a''b''c'));
$array_b = new ArrayIterator(array('d''e''f'));

$iterator = new AppendIterator;
$iterator->append($array_a);
$iterator->append($array_b);

foreach (
$iterator as $current) {
    echo 
$current;
}
?>

以上例程会输出:

abcdef

参见

User Contributed Notes

There are no user contributed notes for this page.

CopyRight © 2008-2022 verySource.Com All Rights reserved. 京ICP备17048824号-1 京公网安备:11010502034788