i have a session looking like this:
array(1) {
[31]=>
array(10) {
["aantal"]=>
int(1)
["id"]=>
string(2) "31"
["filmtitel"]=>
string(16) "2_fast_2_furious"
["film_id"]=>
string(1) "1"
["zaal_id"]=>
string(1) "1"
["dag"]=>
string(8) "woensdag"
["zaaltitel"]=>
string(6) "zaal 1"
["tijdstip"]=>
string(8) "17:30:00"
["stoeltjes"]=>
array(3) {
[0]=>
string(2) "20"
[1]=>
string(2) "21"
[2]=>
string(2) "22"
}
["aantalStoeltjes"]=>
string(3) "150"
}
}
my question is, how can i overwrite the content of ["stoeltjes"]?
when i do unset($_SESSION['addToCart'][$id]["stoeltjes"]);
then ["stoeltjes"]gets deleted but when i add other values they get put in an extra array inside the stoeltjes array.
I assign the new values ass following: $_SESSION["addToCart"][$id]["stoeltjes"][] = $seats;
should do it.