title: comma seperated checkbox $_GET query request with jquery
body: <p>Trying to create a search function using multiple checkboxes, but seem to be only finding information related to $_POST requests.</p>
  
  <pre><code>&lt;input type="checkbox" name="fruit" value="1"&gt;
  &lt;input type="checkbox" name="fruit" value="2"&gt;
  &lt;input type="checkbox" name="fruit" value="3"&gt;
  &lt;input type="checkbox" name="fruit" value="4"&gt;
  &lt;input type="checkbox" name="fruit" value="5"&gt;
  </code></pre>
  
  <p>What is the best way to get the query to look like this</p>
  
  <pre><code>search?fruit=1,2,3,4
  </code></pre>
  
  <p>Is there a way to do this non ajax?</p>
  
  <p>Just to clarify...</p>
  
  <p>Each value represents a different fruit. </p>
  
  <p>Originally I did this</p>
  
  <p>
   </p>
  
  <pre><code>search?apple=1&amp;orange=1
  </code></pre>
  
  <p>As I added more checkboxes, the query seemed inefficient.</p>
  
  <p>I know that I can add the checkboxes into the array using the $_POST method</p>
  
  <pre><code>&lt;input type="checkbox" name="fruit[]" value="1"&gt;
  &lt;input type="checkbox" name="fruit[]" value="2"&gt;
  </code></pre>
  
  <p>As a few have suggested using this technique for a $_GET query would look something like this</p>
  
  <pre><code>search?fruit[]=1&amp;fruit[]=2&amp;fruit[]=5
  </code></pre>
  
  <p>So the question is really how to clean it up (comma seperated)</p>