I have a SESSION array $_SESSION['cart']
for example it has value as
Array
(
[0] =>
[1] => Array
(
[item_id] => 1420
[item_qty] => 1
)
[2] => Array
(
[item_id] => 1522
[item_qty] => 1
)
)
Now let's say I have item_id = 1420
now I want to increase the item_qty for item_id = 1420 and also I have to set it in that SESSION array.
What I tried it :
foreach($_SESSION['Cartquantity'] as $key => $d)
{
if(isset($d)) {
if($d['item_id'] == $_GET['item_id'])
{
$d['item_quntity'] = $d['item_quantity']+1;
}
}
else{
}
}
It's not working ?