Reply to Re: [PHP] Recursive Array Iterator

Your name:

Reply:


Posted by Gerard Samuel on 01/19/05 01:23

Gerard Samuel wrote:

> Im trying to figure out how to create this.
> But Im stuck in the foreach loop.
> For some reason, $value in the foreach loop is not an object (Isn't is
> supposed to be?)
> Any hints to get me in the right direction.
> Thanks
>
> $array = array(1 => array(2 => array(3 => array(4))));
>
> class recursiveArrayIterator extends ArrayIterator implements
> RecursiveIterator
> {
> function __construct($array)
> {
> parent::__construct( $array );
> }
>
> function hasChildren()
> {
> }
>
> function getChildren()
> {
> }
> }
>
> $obj = new recursiveArrayIterator( $array );
> //reflectionObject::export($obj);
> foreach($obj as $value)
> {
> var_dump($value);
> }


Never mind. I figured it out...

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация