I’m having a hard time working with this array.
Okay so I have a multi dimensional array that I’m supposed to print out the values below but using the while loop only “while (list ($key, $value) = each($array))”.
Item one: price
Item two: price
Item three: price
Then, Total them = price + shipping + tax
[php]$products = array(
‘Candle Holder’ => array(
‘price’ => 11.95,
‘shipping’ => 0),
‘Coffee Table’ => array(
‘price’ => 99.50,
‘shipping’ => 0.10),
‘Floor Lamp’ => array(
‘price’ => 44.99,
‘shipping’ => 0.10)
);
// start table and print heading
while (list($key,$value) = each($products))
{
echo “$key: $value
”;
while (list($key,$value) = each($products))
{
echo “$key: $value
”;
}
// I have a function that calculates total here
}[/php]