title: sending jquery array with ajax / json
body: <p>Hi im trying to send my arrays through ajax with json encode, but my data is always empty. What am i doing wrong. the results im trying to get with a print_r($_POST); i also tried json stringify but still not working.</p>
  
  <p>js code:</p>
  
  <pre><code> $("#submitboeking").click(function(event) {
  
                  event.preventDefault();
  
  
                  //Cursisten
                  var voornamen = [];
                  var achternamen = [];
                  var geslachten = [];
                  var geboortedata = [];
  
                  $("[id^='txtCursistVoornaam']").each(function() {
                      voornamen.push($(this).val());
                  });
                  $("[id^='txtCursistAchternaam']").each(function() {
                      achternamen.push($(this).val());
                  });
                  $("[id^='radCursistGeslacht']:checked").each(function() {
                      geslachten.push($(this).val());
                  });
                  $("[id^='txtCursistGeboortedatum']").each(function() {
                      geboortedata.push($(this).val());
                  });
  
                  $.ajax({
                      url: '/wp-content/themes/tweb/processboeking.php',
                      type: 'POST',
                      data:
                          {'geslachten': geslachten,
                          'voornamen': voornamen,
                          'achternamen': achternamen,
                          'geboortedata': geboortedata},
                      dataType: 'json',   
  
                      success: function(data) {
                          console.log(data);
                       document.getElementById("overzichtboeking").innerHTML = data;
  
                      }
                  });
  </code></pre>