title: How to send a serialized array to a php document?
body: <p>I've got a JavaScript array named seat with many values in it.</p>
  
  <p>As follows,I've serialized to be sent to a php file named confirm.php.</p>
  
  <pre><code>$('btnsubmit').click(function() {
    var seat = [];
    var seatar = JSON.stringify(seat);
    $.ajax({
      method: "POST",
      url: "confirm.php",
      data: seatar
    })
  })
  </code></pre>
  
  <p>And this is the code in my php file.</p>
  
  <pre><code>$seatarr = "";
  if(isset($_POST['data']))
  {
      $seatarr = $_POST["data"];
      print_r($seatarr);
  }
  </code></pre>
  
  <p>I've tried with my level best, looking at the previous questions asked on this section. But no matter how hard I try to fix it, this code never works. Why not?</p>