title: How to post form serialize data using PHP?
body: <p>I have a form that contain dynamically generated fields. I need to post the form using .serialize().</p>
  
  <p><strong>Ajax</strong></p>
  
  <pre><code>$("#save").click(function () {                              
      formData = $('#myForm').serialize();
      $.ajax({
          type:"POST",         
          url: base_url +'home/save',
          data: {
              formData:formData,
              csrf_test_name: csrf_token
          },
          success: function(response){         
              console.log(response);           
              alert(response);
          }     
      }); 
  });
  </code></pre>
  
  <p>I need to post all the data using input field name. Now I got all the result like that:</p>
  
  <pre><code>   echo $fomdata=$this-&gt;input-&gt;post('formData');
  </code></pre>
  
  <p><strong>output</strong> </p>
  
  <p><code>room_count_new=5&amp;room_id=1&amp;bedcount_1_1=1&amp;extra_age_1_1_1=middle&amp;extra_age_1_1_2=0&amp;bedcount_1_2=0</code></p>
  
  <p>But I want to post with the corresponding name.</p>