I've got a from, with 2 information from 2 field. Everytime you submit the form you came to another page where I want to display them in an array.
What I did is:
$buchtyp = $_POST['buchtyp'];
$a_id_warenkorb = $_POST['a_id_warenkorb'];
$_SESSION['warenkorb'][$a_id_warenkorb] = $a_id_warenkorb;
If I show the content of this array, it failed.
$buchtyp = $_POST['buchtyp'];
$_SESSION['buchtyp'][] = array($buchtyp);
$a_id_warenkorb = $_POST['a_id_warenkorb'];
$_SESSION['warenkorb'][] = array($a_id_warenkorb);
I changed it and now it works. Its not saved in one array, but its fine :)
Try foreach($_POST as $key => $value) { $_SESSION[$key] = $value; }