If you want to use array functions on an ArrayObject, why not use iterator_to_array() to get a standard PHP array? Do your operations on that array, then instantiate a new ArrayObject, passing it the array.
This might be a little slow on large ArrayObjects, but you'd have access to all of the array functions.
ArrayObject クラス
導入
...
クラス概要
ArrayObject
ArrayObject
implements
IteratorAggregate
,
Traversable
,
ArrayAccess
,
Countable
{
/* メソッド */
ArrayObject::__construct
( mixed $input
)
}目次
- ArrayObject::append — 値を追加する
- ArrayObject::__construct — 新規配列オブジェクトを生成する
- ArrayObject::count — イテレータにある要素の数を取得する
- ArrayObject::getIterator — ArrayObject インスタンスから新規イテレータを生成する
- ArrayObject::offsetExists — 要求された $index が存在するかどうかを返す
- ArrayObject::offsetGet — 指定した $index の値を返す
- ArrayObject::offsetSet — 指定した $index に $newval をセットする
- ArrayObject::offsetUnset — 指定した $index の値を解除する
ArrayObject
dave at csixty4 dot com
05-Sep-2008 06:28
05-Sep-2008 06:28
Anonymous
10-Aug-2008 04:17
10-Aug-2008 04:17
Too bad the Array functions [1] are not available on this object… otherwise I would be using it all the time.
[1] http://nl.php.net/manual/en/ref.array.php
