jquery: Update variable number of values using $.post
<p>i want to update variable number of items in ajax. What i have is</p>

<pre><code>&lt;input name="cart[qty][25]" id="25" value="10" size="4" title="Qty" class="input-text qty"&gt;
</code></pre>

<p>suppose there are 10 similar fields in my form and lots of other fields too which don't need to be updated.</p>

<p>i want to update the item quantity in cart whose id is equal to the id of the text field. I know it can easily be done in php using </p>

<pre><code>if(isset($_POST['update'])){
  foreach($_POST['cart']['qty'] as $k=&gt;$v)
{
  // Do stuff
}
</code></pre>

<p>But i want this in $.post something like</p>

<pre><code>jQuery(".update-cart").on('click',function(){
  jQuery(".cart-item").each(function(){
  var  id = jQuery(this).attr('id');
  var qty = jQuery(this).val();
    //What should i do here and on my php file ?
  });
});
</code></pre>
