How to pass a PHP array to JS and generate a JS array
<pre><code>$allVal =  array(array(123, 0), array(345, 1), array(456, 2));
</code></pre>

<p>Code at above is an PHP array, currently I would like to pass this array to javascript and the output in Javascript should look like the following:</p>

<pre><code>&lt;script type="text/javascript"&gt;
      var d = [[123, 0], [345, 1], [456, 2]];
&lt;/script&gt;
</code></pre>

<p>BTW: PHP code and Js code in the same page.</p>

<p>Is there anyone can help me? Thanks in advance!</p>
