I am passing arrays from a product page and using the $_GET['id'] to store product ids in 'id' then storing it in session['items'].
On the cart page, I would like to echo out only the 'id' elements of the array and not the qty. But I still want to keep the current code where $item and $value are echo.
Add-to-cart.php
**code
session_start();
$_SESSION['items'][]=array(
'id'=>"'".$_GET['id']."'",
'qty'=> 1
);
?>
Cart.php
**code
<?php
session_start();
foreach($_SESSION['items'] as $items=>$values)
{
foreach($values as $item=>$value)
{
//// I want to keep this,
echo $item;
echo $value."<br/>";
echo "</br>";
//// I want to keep this
//// echo 'id' values here!
}
}
?>