note 84626 deleted from ref.spl by danbrown
| From: | danbrown@php.net | Date: | Tue, 22 Jul 2008 16:59:26 +0000 |
| Subject: | note 84626 deleted from ref.spl by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142510@lists.php.net to get a copy of this message | ||
Note Submitter: benny at whitewashing dot de
----
The following construct allows to represent multidimensinal arrays using ArrayObject:
<?php
class ArrayMultiObject extends ArrayObject
{
function __construct($array, $flags = 0, $iterator_class = "ArrayIterator")
{
$objects = array();
foreach($array AS $key => $value) {
if(is_array($value)) {
$objects[$key] = new MultiArray($value, $flags, $iterator_class);
} else {
$objects[$key] = $value;
}
}
parent::__construct($objects, $flags, $iterator_class);
}
}
?>