How to separate answers
<p>Below I have a piece of code which combines each answer per question:</p>

<pre><code>// $questionNumber is simply n in value[n][]
// $answers is an array of value attributes from &lt;input&gt;s for this question

foreach ($_POST['value'] as $questionNumber =&gt; $answers) {
    // combine all the answers into a single string (e.g. ACE)
    $selected_answer = implode('', $answers);

    // continue onto inserting rows into the Answer and Questions tables
    // ...
}
</code></pre>

<p>So for Example:</p>

<pre><code>Question 1: Answer: ACE
Question 2: Answer: BD
Question 3: Answer: C
</code></pre>

<p>But I actually want to seperate the answers so that it displays it like below:</p>

<pre><code>Question 1: Answer: A
Question 1: Answer: C
Question 1: Answer: E
Question 2: Answer: B
Question 2: Answer: D
Question 3: Answer: C
</code></pre>

<p>So what my question is that what do I need change in my php so that it seperates them?</p>

<p>Is it suppose to be like below:</p>

<pre><code>// $questionNumber is simply n in value[n][]
// $answers is an array of value attributes from &lt;input&gt;s for this question

foreach ($_POST['value'] as $questionNumber =&gt; $answers) {
    // combine all the answers into a single string (e.g. ACE)
    $selected_answer = $answers;

    // continue onto inserting rows into the Answer and Questions tables
    // ...
}
</code></pre>
