RE: [PHP] fruity arrays
| From: | Richard Black | Date: | Tue, 13 Aug 2002 09:47:24 +0000 |
| Subject: | RE: [PHP] fruity arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-112284@lists.php.net to get a copy of this message | ||
<snip>
$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),
</snip>
Shouldn't the parameter to array_keys (and obviously array_values too)
be $fruit_array_of_choice, and not just $fruit_array???
That might stop the warnings...
HTH,
Richy
==========================================
Richard Black
Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 435 3504
Email: rblack@datavisibility.co.uk