Posted by Rik on 02/07/07 16:43
Aggelos <djjelly@gmail.com> wrote:
> This is my suggested sollution:
> It succesfully returns the object ... ofcourse you have to initialise
> the tempArray but I wasn't very sure about it ...
>
> function recurseArray($array) {
> if(is_array($array)) {
> foreach($array as $arrayValue) {
> $tempArray =3D recurseArray($arrayValue);
> }
> }
> elseif(is_object($array)) {
> return $array;
> }
> return $tempArray;
> }
This will only return the _last_ object found, as you continue to =
overwrite $tempArray for every array-element.
-- =
Rik Wasmus
Navigation:
[Reply to this message]
|