using for loop value from javascript with php variable
<p>I have this code that executes a for loop in javascript with a php array inside of it.  Is there anyway I can use the variable for the loop inside of the php variable for example.  This is all inside of php.</p>

<pre><code>echo '&lt;script&gt;
for (var i =0; i&lt;4;i++){

alert("hey"'.$phparr[i].');



}&lt;/script&gt;';
</code></pre>

<p>I know this will not work because the $phparr is a php variable while the i is a javascript variable is there anyway I can do this?</p>
