title: PHP form and serializeArray
body: <p>I have my data like this:</p>
  <pre><code>&quot;waveOptions&quot; =&gt; array(
              &quot;barWidth&quot; =&gt; 2,
              &quot;barRadius&quot; =&gt; 0
   ),
  </code></pre>
  <p>My form:</p>
  <pre><code>   &lt;input type=&quot;number&quot; min=&quot;0&quot; step=&quot;1&quot; name=&quot;waveOptions[barWidth]&quot; value=&quot;&lt;?php echo($options['waveOptions']['barWidth']); ?&gt;&quot;&gt;
     &lt;input type=&quot;number&quot; min=&quot;0&quot; step=&quot;1&quot; name=&quot;waveOptions[barRadius]&quot; value=&quot;&lt;?php echo($options['waveOptions']['barRadius']); ?&gt;&quot;&gt;
  </code></pre>
  <p>When I submit form I use jQuery serializeArray</p>
  <pre><code>var options = { };
  $.each($('form').serializeArray(), function() {
     options[this.name] = this.value;
  });
  </code></pre>
  <p>and I sent this to php ith JSON.stringify(options) and then save this in table with serialize($options). However when I retrieve the values with php its showing me this:</p>
  <pre><code>[&quot;waveOptions[barWidth]&quot;]=&gt; string(1) &quot;x&quot; [&quot;waveOptions[barRadius]&quot;]=&gt; string(1) &quot;y&quot;
  </code></pre>
  <p>How do I format the input name</p>
  <pre><code>name=&quot;waveOptions[barWidth]&quot;
  </code></pre>
  <p>so it saves this as its retrieved</p>
  <pre><code> $options['waveOptions']['barWidth'] ?
  </code></pre>