I am new with php. I want store multidimensional associative array in session and also fetch the value of array from session. But I am not able to do this properly. Below is my code. Thanks.
$myArray = array();
if ((!isset($_SESSION['game']))) {
echo 'the session is either empty or doesn\'t exist';
} else {
$myArray = unserialize($_SESSION['game']);
}
array_push($myArray, new MapResult($keyId, $colorCode, 'NP', $highlow, 'NP', $evenOdd, 'NP'));
session_start();
$_SESSION['game'] = serialize($myArray);
?>