we can append values after the given array,the index is begin from 0, for example:
<?php
$b = array('name'=>'mengzhi','age'=>'22','city'=>'shanghai');
$a = new ArrayIterator($b);
$a->append(array('home'=>'china','work'=>'developer'));
var_dump($a);
?>
then output:
object(ArrayIterator)#1 (1) { ["storage":"ArrayIterator":private]=> array(4) { ["name"]=> string(7) "mengzhi" ["age"]=> string(2) "12" ["city"]=> string(8) "shanghai" [0]=> array(2) { ["home"]=> string(5) "china" ["work"]=> string(9) "developer" } } }
ArrayIterator::append
(PHP 5 >= 5.0.0)
ArrayIterator::append — Append an element
Description
Appends value as the last element.
Warning
This function is currently not documented; only its argument list is available.
Parameters
-
value -
The value to append.
Return Values
No value is returned.
Notes
Note:
This method cannot be called when the ArrayIterator refers to an object.
lenye01 at gmail dot com
10-Feb-2011 08:11
