(PHP 5 >= 5.1.0, PHP 7)
AppendIterator::append — Appends an iterator
public AppendIterator::append ( Iterator $iterator ) : void
Appends an iterator.
iterator
The iterator to append.
No value is returned.
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; } ?>
The above example will output:
abcdef
© 1997–2020 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/appenditerator.append.php