title: Save Input fields as array in PHP
body: <p>I have Input fields that result in an array after POST:</p>
  
  <pre><code>&lt;tr&gt;
  &lt;td&gt;&lt;input name="time['day'][]" value="1"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="time['from][]" value="1"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="time['to][]" value="1"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;td&gt;&lt;input name="time['day'][]" value="2"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="time['from][]" value="2"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="time['to][]" value="2"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>This will be return:</p>
  
  <blockquote>
    <p>Array (</p>
  
  <pre><code>['day'] =&gt; Array
      (
          [0] =&gt; 1
          [1] =&gt; 2
      )
  
  ['from] =&gt; Array
      (
          [0] =&gt; 1
          [1] =&gt; 2
      )
  
  ['to] =&gt; Array
      (
          [0] =&gt; 1
          [1] =&gt; 2
      )
  </code></pre>
    
    <p>)</p>
  </blockquote>
  
  <p>But I would like to have this:</p>
  
  <blockquote>
    <p>Array (
        [1] => Array</p>
  
  <pre><code>    (
          ['day'] =&gt; 1
          ['from] =&gt; 1
          ['to] =&gt; 1
      )
  
  [2] =&gt; Array
      (
          ['day'] =&gt; 2
          ['from] =&gt; 2
          ['to] =&gt; 2
      )
  </code></pre>
    
    <p>)</p>
  </blockquote>
  
  <p>I get this if I use:</p>
  
  <pre><code>&lt;tr&gt;
  &lt;td&gt;&lt;input name="time[1]['day']" value="1"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="time[1]['from]" value="1"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="time[1]['to]" value="1"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;td&gt;&lt;input name="time[2]['day']" value="2"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="time[2]['from]" value="2"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="time[2]['to]" value="2"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>But here comes the problem. I want to add new rows dynamicly (with JS) and would need to add always +1 to the first index.</p>
  
  <p>How could I achive the second result without having to set the first index manually?</p>