ArrayIterator
在线手册:中文 英文
PHP手册

ArrayIterator::append

(PHP 5 >= 5.0.0)

ArrayIterator::appendAppend an element

说明

public void ArrayIterator::append ( mixed $value )

Appends value as the last element.

Warning

本函数还未编写文档,仅有参数列表。

参数

value

The value to append.

返回值

没有返回值。

注释

Note:

This method cannot be called when the ArrayIterator refers to an object.

参见


ArrayIterator
在线手册:中文 英文
PHP手册
PHP手册 - N: Append an element

用户评论:

lenye01 at gmail dot com (11-Feb-2011 04:11)

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" } } }