title: jQuery $.ajax to pass multidimensional array to PHP
body: <p>I am using jQuery and PHP to write JSON data to my server. I'm processing a decent amount of repeating numeric data (~.75kb), so I want to pass the data to PHP in the form of a multidimensional array.</p>
  
  <p>At the moment I cannot manage to get the data to PHP in a form that it can recognize. I've tried various combinations of sending/receiving as arrays and objects with no success.</p>
  
  <p>The best case scenario would be one in which I pass a the array to the PHP and the PHP converts it to a readable form. I'd rather not use associative arrays or any serializing on the part of the Javascript.</p>
  
  <p>Code... This is giving me a 500 internal server error, which no longer occurs if I omit the passed data variable. (I'm not yet using $data in the php file yet because I know it's not working.)</p>
  
  <pre>
  function generateData() {
    // code here
    return [ one[ sub_one[], sub_two[] ], two[], three[], four[] /* Etc... */ ]
  }
  function saveData() {
      $.ajax({
          url: "scripts/save.php",
          data: {
              "area":"testing",
              "location":"testing",
              "name":"testing",
              "data":generateData()
          }
      });
  }
  </pre>
  
  <pre><code>&lt;?php
      $area = $_GET['area'];
      $location = $_GET['location'];
      $name = $_GET['name'];
      $data = $_GET['data']);
  
      # Performing operations with variables...
  
      echo 1;
  ?&gt;
  </code></pre>
  
  <p>Thanks for any help you can offer.</p>