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 ..
This is the sample code ...
echo '<script type="text/javascript">';
<other javascript code .... >
echo 'arr_selections_json = JSON.stringify(arr_selections);';
echo 'document.write("<input type="hidden" name="arr_selections_json" value="+arr_selections_json+" />")';
This code doesn't work .... Any suggestions? Thank you in advance .. .