Re: Thinking out loud - a continuation...

From: Date: Fri, 23 Mar 2012 21:41:39 +0000
Subject: Re: Thinking out loud - a continuation...
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  Groups: php.general 
Request: Send a blank email to php-general+get-317240@lists.php.net to get a copy of this message
[snip] …stuff…. [/snip] For those interested here is where the problem seems to occur - $child = array ( 'id' => $id, 'parentId' => $pid, 'children' => array() ); $children[$id][] = &$child; foreach( $parents[$pid] as &$items ){ foreach( $items as &$item ){ $item['children'][$id] = &$child; // error: Cannot use string offset as an array } } Maybe someone will see this and know what's going on. Before the foreach $children is an array.

« previous php.general (#317240) next »