Pass multiple javascript arrays to PHP page
<p>I was trying to find an answer for this question for a while but no luck.</p>

<p>The problem is this. On one PHP page i have multiple javascript arrays (lets say 2). One of those arrays is an array that represents pieces of a shirt and the other array contains color of each piece.</p>

<pre><code>  $pieces[0] = 'base';
  $pieces[1] = 'sleeves';
  $pieces[2] = 'pocket';

  $colors[0] = 'white';
  $colors[1] = 'red';
  $colors[2] = 'black';
</code></pre>

<p>On top of all that i have a form with where user can enter some data.</p>

<p>Now my question is, how can I pass those two arrays and form data to a PHP page? </p>

<p>Thanks for all your help.</p>

<p>/<strong><em>*</em>**<em>*</em>**</strong><br>
EDIT</p>

<p><em><strong></em>**<em>*</em>***</strong>/</p>

<p>Well in case that someone has the same problem the solution is to serialize the arrays, insert them in a hidden field on a form and deserialize it on a PHP page</p>

<p><a href="http://code.activestate.com/recipes/414334-pass-javascript-arrays-to-php/" rel="nofollow">http://code.activestate.com/recipes/414334-pass-javascript-arrays-to-php/</a></p>
