Re: RecursiveArrayIterator

From: Date: Wed, 25 Jul 2007 04:36:55 +0000
Subject: Re: RecursiveArrayIterator
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-259482@lists.php.net to get a copy of this message
On Sun, July 22, 2007 9:02 pm, Kevin Waterson wrote: > This one time, at band camp, "Nathan Nobbe" <quickshiftin@gmail.com> > wrote: > > Thanks for the response. > I was hoping to avoid this sort of recursion within userspace and keep > it at a lower level. Should not the recursive iterator recurse so we > dont need to be using user defined functions? > >> printArrayKeysRecursively($innerRecursiveArrayIterator); // handle >> printing I don't understand this SPL stuff (and don't want to, as it just gives me a headache to even look at the function names) but you've got this: $foo = array( array ( 'a', 'b', 'c')); So of course your outer array has 0 => [inner array] in it. How you get some funky SPL thing to only dump out the inner array is beyond me... There is an array_collapse or somesuch that will sort of smush all the sub-arrays into one big array, which might do what you want. Or not. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#259482) next »