dynamic indexes in arrays

From: Date: Wed, 29 May 2002 04:23:17 +0000
Subject: dynamic indexes in arrays
Groups: php.general 
Request: Send a blank email to php-general+get-99618@lists.php.net to get a copy of this message
I have a member variable of a class that I am designing called $m_menu. I am trying to add items to it using the contents of $index as the index for the 'slot' in the array, but I get a parse error when I do so. array_push($this->m_menu, $index =>array("title"=>$title, "content"=>"", "color"=>$color)); Is there any way to create indexes in arrays from variables? - - Joe joe@joepnet.com

« previous php.general (#99618) next »