title: Send array of objects as POST data without ajax
body: <p>I have an HTML form. When the form is submitted, a jQuery code is executed to append an array of objects before data is sent to the server. Each object contains information retrieved outside the form.</p>
  
  <pre><code>&lt;form method="post" id="formID" action="test.php" accept-charset="utf-8"&gt;
      &lt;!-- form inputs --&gt;
  &lt;/form&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>$('#formID').submit(function() {
      var form = $(this);     
      $('.file').each(function(index) {
          var filedata = {
              name: $(this).find('.name').text(), 
              ordernum: index, 
              size: $(this).find('.size').text()
          };
          form.append('&lt;input type="hidden" name="filedata[]" value="' + filedata + '"/&gt;');
      });
  });
  </code></pre>
  
  <p>My goal would be to retrieve these information on server side. Unfortunately, when I output <code>$_POST</code> data, I only get a generic <code>Object</code> data.</p>
  
  <pre class="lang-php prettyprint-override"><code>echo '&lt;pre&gt;';
  print_r($_POST['filedata']);
  echo '&lt;/pre&gt;';
  
  /* output */
  Array
  (
      [0] =&gt; [object Object]
      [1] =&gt; [object Object]
  )
  </code></pre>
  
  <p>Is there a way to send an array of objects when submitting a form to server without using AJAX requests?</p>