title: Writing HTML code in Javascript inside a PHP code
body: <p>I need to write in PHP, inside a Javascript portion code, an hidden input tag with an javascript array that I need to pass to another PHP code ..</p>
  
  <p>This is the sample code ... </p>
  
  <pre><code>    echo '&lt;script type="text/javascript"&gt;';
  
      &lt;other javascript code .... &gt;
  
      echo 'arr_selections_json = JSON.stringify(arr_selections);';
      echo 'document.write("&lt;input type="hidden" name="arr_selections_json" value="+arr_selections_json+" /&gt;")';
  </code></pre>
  
  <p>This code doesn't work .... Any suggestions? 
  Thank you in advance .. .</p>