title: How exactly do you use json_decode to pass a javascript array to php?
body: <p>This is how I got my php array to javascript</p>
  
  <pre><code>echo 'var daysofweek = '.json_encode($daysofweek).';';
  </code></pre>
  
  <p>Now I am aware that json_decode can do the opposite, however the problem is I don't know the syntax to do so.</p>
  
  <p>I tried:</p>
  
  <pre><code>&lt;script&gt;
  var array_days = new Array();
  
  array_days[] = "psdfo";
  array_days[] = "bsdf";
  
  &lt;?php
  $array_days = json_decode(?&gt;array_days&lt;?php);?&gt;
  
  &lt;/script&gt;
  </code></pre>
  
  <p>yes im clueless.</p>
  
  <p>I forgot to mention that I want to send an array through post, having all my information regarding all the form values dynamically created by javascript. Otherwise, I wouldn't know which name="" to look for as it will be decided by the user. Unless someone else has an alternative solution...</p>