 <pre><code>$result2[$value] = array( $options_key =&gt; $_POST[$options_key][$value] ); // problem ! </code></pre> <p>Change to:</p> <pre><code>if( !isset($result2[$value])) $result2[$value] = array(); $result2[$value][$options_key] = $_POST[$options_key][$value]; </code></pre>