= 5.1.0, PHP 7, PHP 8)AppendIterator::append — Appends an iterator說明public AppendIterator::append(Iterator $iterator): v">
(PHP 5 >= 5.1.0, PHP 7, PHP 8)
AppendIterator::append — Appends an iterator
iterator
The iterator to append.
沒有返回值。
示例 #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;
}
?>
以上例程會(huì)輸出:
abcdef