title: Take array value with radio input
body: <p>I'm using javascript to clone a form according to the int value. I'm using <code>[]</code> brackets for taking array value from other input type.  </p>
  
  <pre><code>&lt;input type="text" name="state[]" class="form-control" id="state" required&gt;
  </code></pre>
  
  <p>and used same for radio input.</p>
  
  <pre><code>&lt;input type="radio" name="gender[]" value="Male"&gt;Male
  </code></pre>
  
  <p>using loop in server side to save those data into db.</p>
  
  <pre><code>for ($i = 0; $i &lt;= $request-&gt;limit; $i++) {
      $user-&gt;name = $request-&gt;name[$i];
      $user-&gt;gender = $request-&gt;gender[$i];
      $user-&gt;address = $request-&gt;address[$i];
      $user-&gt;save();
  }
  </code></pre>
  
  <p>I'm getting error of <code>Undefined offset: 1</code> on the line:</p>
  
  <pre><code>$user-&gt;gender = $request-&gt;gender[$i];
  </code></pre>
  
  <p>as because radio input cannot hold data in array form. When I dump and die request all inputs except radio has data in array form. And value of radio input is succeeded by the value of next radio input of cloned form. </p>
  
  <p>How can I get array value from radio input?</p>