使用PHP的foreach输出数组

I created in Array and everytime i output it, there is only one row shown. I want to show every row. Here is the code:

//Input in Array
$_SESSION['warenkorb'][] = array('warenkorb_id' => $_POST['a_id_warenkorb'], 'buchtyp' => $_POST ['buchtyp'], 'menge' => $_POST['menge']);

//Array Output
    foreach ($_SESSION['warenkorb'] as $index => $inhalt);
            {
            echo $inhalt['warenkorb_id'];
            echo $inhalt['buchtyp'];
            echo $inhalt['menge'];
            }

I hope someone can help me :) Lukas

Remove semicolon(";") at end of foreach.

foreach ($_SESSION['warenkorb'] as $index => $inhalt)
  1. Page load only once so you get only one array
  2. There is only one array so you it disolays one row only
  3. Add session_start(); at start of file

Try This

<?php
session_start();
$_SESSION['warenkorb'][] = array('warenkorb_id' => $_POST['a_id_warenkorb'], 'buchtyp' => $_POST ['buchtyp'], 'menge' => $_POST['menge']);

//Array Output
    foreach ($_SESSION['warenkorb'] as $index => $inhalt);
            {
            echo $inhalt['warenkorb_id'];
            echo $inhalt['buchtyp'];
            echo $inhalt['menge'];
            }
?>