title: How to insert multiple inputs with same name in php through ajax
body: <p>I have html form that allowed to insert multiple input. I am able to insert only first input. How to insert multiple value in <code>php</code> passing through <code>ajax</code>, My HTML form is as below.</p>
  
  <pre><code>&lt;tr&gt;
      &lt;th&gt;ID&lt;/th&gt;
      &lt;td&gt;&lt;input type="number" id="navid"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;th&gt;Menu IN&lt;/th&gt;
      &lt;td&gt;&lt;input type="text" name="menuin"&gt;&lt;/input&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;th&gt;Menu ENG&lt;/th&gt;
      &lt;td&gt;&lt;input type="text" name="menueng"&gt;&lt;/input&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>User can add input field dynamically(dynamic add has be done by jquery)
  <a href="https://i.stack.imgur.com/CYQDE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CYQDE.png" alt="enter image description here"></a>
  It is not problem to pass if only one input group. But I want to pass multiple input if user add more than one. </p>
  
  <p>And I've passed value as</p>
  
  <pre><code>$("#submit").click(function(){
      var navid = $("#navid").val();
      var menuin = $("input[name='menuin']").val();
      var menueng = $("input[name='menueng']").val();
      $.ajax({
          url: 'insert_nav.php',
          type: 'post',
          data: {navid:navid,menuin:menuin,menueng:menueng},
          success: function(data){
              alert(data);
              $('#nav')[0].reset();
          }
      });
  });
  </code></pre>
  
  <p>I've inserted input values passed by ajax as below</p>
  
  <pre><code>if (isset($_POST["navid"]) &amp;&amp; !empty($_POST["navid"])) {
          $query1 =$con-&gt;prepare("INSERT INTO menu(cid, title, en_title) VALUES (:navid, :menuin, :menueng)");
          $query1-&gt;bindParam(':menuin',$_POST["menuin"]);
          $query1-&gt;bindParam(':menueng',$_POST["menueng"]);
          $query1-&gt;bindParam(':navid', $_POST["navid"]);
          $query1-&gt;execute();
          $msg1 = 'Menu has inserted';    
      }
  </code></pre>
  
  <p>Now I want to insert multiple values. How to do ?</p>