javascript variable in quoted php code in javascript
<p>the title sounds weird, but here's  my question.
I am making this loop in Javascript that needs to call PHP variables. </p>

<pre><code>    var data = new Array("&lt;?php echo count($result) ?&gt;");
    for (var i=0; i &lt; "&lt;?php echo count($result) ?&gt;"; i++) {
        data[i] = "&lt;?php echo $result[i] ?&gt;";
    }
</code></pre>

<p>The third line is the problem.
I tried </p>

<pre><code>            data[i] = "&lt;?php echo $result [" + i + " ] ?&gt;";
</code></pre>

<p>but it didn't work.</p>

<p>Any clever tip to solve this??</p>
