Recursive Array Iterator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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);
}

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux