Passing a multidimensional PHP array to javascript
<p>I have an array($my_array) that looks something like:</p>

<pre><code>array(2) {
[25]=&gt;int(10)
[30]=&gt;int(8)
}
</code></pre>

<p>I'd like to assign it to a javascript array, but am having difficulties doing it.  Any suggestions?</p>

<p>Edit: At first, I thought I could just assign it like a string, but that isn't working:</p>

<pre><code>var photo_limit = $my_array;
</code></pre>

<p>I tried also doing a var_dump into my js value.</p>

<p>I'm currently trying to use something like:</p>

<pre><code>for($i=0;$i&lt;count($my_array); $i++){
echo "a[$i]='".$a[$i]."';\n";
}
</code></pre>

<p>Thanks.</p>
