title: How to send a checkbox group via ajax in jquery?
body: <p>I need to send a group of checkboxes (with some other data as well) via ajax in jquery.</p>
  
  <p>What I've done so far is: </p>
  
  <pre><code>var arr = $('#somediv input[type="checkbox"]:checked').val() || [];
  $.post("/somephpfile.php", {str: str, arr: arr}, function(data) {...
  </code></pre>
  
  <p>But my problem is that the arr is never an array. What I need is to send it as ?str=data&amp;arr=foo&amp;arr=bar</p>
  
  <p>I guess this is a very simple question, but since I am very new to jquery I'll ask the pros.
  How should I do it?</p>
  
  <p>Thank you.</p>
  
  <hr>
  
  <p><strong>My bad, it was the php</strong></p>