I am trying to either set an array or update the current array that is held within a session - for some reason it isnt working and is throwing a error (Warning: array_push() expects parameter 1 to be array, integer given in C:\xampp\htdocs\site\folder\cart.php on line 41)
This is the code
echo "empty session <br>";
$cartData = array('itemId' => $articleId, 'itemTitle' => $articleTitle);
$_SESSION['cart'] = $cartData;
echo "full session <br>";
$cartData = $_SESSION['cart'];
$cartData = array_push($cartData,$articleId,$articleTitle);
echo "The END: <br>";
//echo $where . "<br>";
so far its very simple, I am checking to see if the session is set and if not I create the inital array and assign it to the session there after I should just be pushing into the array and updating the session but as said it throwing the above error.
What am I doing wrong!