This seems like a rather silly question, but how do I store a $_GET variable in an array?
I have tried:
$bag = get_item();
$_SESSION['cart'] = array();
$_SESSION['cart'] = [$bag];
The problem with this is it only stores the current $_GET variable. When you move to a different page and click a different product it overwrites the variable.
So I want to put it in the array (store past $_GET variables) not have it be the only thing in the array. Anyone know how to do this??