title: jquery ajax post multi dimensional array to php
body: <p>I am having a download as csv button for exporting the results as csv. Till now I was using server side code for this. I was sending the selected DropDowns Ids to csvdownload.php page which is writing the results in excel.</p>
  
  <p>BUT NOW, I want a utility for selecting the search results using checkbox and then the selected results should written to the csv. </p>
  
  <p>I am planning to get the table data in array and then post it to php using ajax, then it will do the rest of things. But how is this possible to post multiple rows of data to php. <strong>I have following piece of code for getting the table data which is alerting data but dont know how to make it as array and pass to php</strong></p>
  
  <pre><code>      $('#tblSearchResults tr').filter(':has(:checkbox:checked)').each(function() {
       $tr = $(this);
         //alert($tr.find("td").eq(4).html());
  
          var risk_cat = $tr.find("td").eq(1).html();
          var risk_type = $tr.find("td").eq(2).html();
          var risk_desc = $tr.find("td").eq(3).html();
          var treat_desc = $tr.find("td").eq(4).html();
          var treat_cat = $tr.find("td").eq(5).html();
  
          selectedData.push({"risk_cat": risk_cat, "risk_type": risk_type, "risk_desc": risk_desc, "treat_desc": treat_desc, "treat_cat": treat_cat});
  </code></pre>
  
  <p>thanks</p>