fruity arrays

From: Date: Tue, 13 Aug 2002 09:42:57 +0000
Subject: fruity arrays
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-112283@lists.php.net to get a copy of this message
i have these arrays: $A_fruit_list = array('A1' => 'Fruit A1', 'A2' => 'Fruit A2', ); $B_fruit_list = array('B1' => 'Fruit B1', 'B2' => 'Fruit B2', ); then i do these: $var = "B"; $var_list = $var."_fruit_list"; //Note: variable variable below $fruit_array_of_choice = ${$var_list}; $FRUIT_code => array_keys($fruit_array), $FRUIT_name => array_values($fruit_array), which generates these warnings: Warning: First argument to array_keys() should be an array in /home/httpd/vhost/home/fruits.php on line 14 Warning: Argument to array_values() should be an array in /home/httpd/vhost/home/ureg/fruits.php on line 15 how do i script around that ? -- roger __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com

« previous php.general (#112283) next »