Help with a foreach statement
Hi Ron,
This code should work:
<?php
$path_to_shopping_cart = './';
$iLength = count($cart);
foreach ($cart as $product_name => $quantity)
{
echo "<li><a href=\"" . $path_to_shopping_cart . "product/" .
$cart[$product_id] . "/\">" . $product_name . "</a> - " . $quantity .
"</li>\r\n";
}
?>
Though I'm not sure about $cart[$product_id]. Where is that coming
from?. It makes no sense here. Perhaps you want to do a
tri-demensional array in $_session, so you will have a
dual-demesnional array in $cart.
Let me know,
- Craige
|