Re: Pushing to Multidimensional Arrays.

From: Date: Tue, 15 May 2001 11:43:58 +0000
Subject: Re: Pushing to Multidimensional Arrays.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-52837@lists.php.net to get a copy of this message
On Tuesday 15 May 2001 11:44, Nick Davies wrote: > How do i do this? > > I have tried using the array_push function without sucess and when i > try this : > > $stack[]['id'] = $menuArray[$rowID]['id']; > $stack[]['parentId'] = $menuArray[$rowID]['parentId']; > $stack[]['name'] = $menuArray[$rowID]['name'];A > > obviously the array's internal pointer will increment and it will write > to the next element. $Foo = array (); $Foo['id'] = $menuArray[$rowID]['id']; $Foo['parentId'] = $menuArray[$rowID]['parentId']; $Foo['name'] = $menuArray[$rowID]['name']; $stack[] = $Foo; -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Error 032: Recursion error - see error 032

« previous php.general (#52837) next »