 <p>Change this line from your form element:</p> <pre><code>name="payment_amount" </code></pre> <p>to be an array:</p> <pre><code>name="payment_amount[]" </code></pre> <p>Then, modify your <code>foreach</code> to read as:</p> <pre><code>foreach ($_POST['payment_amount'] as $value) { echo $value . "&lt;br&gt;"; } </code></pre> <ul> <li>You were using the wrong POST array => <code>name="payment_id[]"</code></li> </ul> <p>To add them all up, should you want to do that, use:</p> <pre><code>foreach ($_POST['payment_amount'] as $value) { echo $value . "&lt;br&gt;"; $total += $value; } echo $total; </code></pre> <p>or</p> <pre><code>$total = array_sum($_POST['payment_amount']); </code></pre>