Pass a javascript variable to php
<p>Newb question so excuse me if there's an obvious answer (I've tried everything I can think of).</p>

<p>I have a javascript variable setup like so:</p>

<pre><code>var imageURL = &lt;?php echo json_encode($imageRows[0]['URL_Path']); ?&gt;;
</code></pre>

<p>Where $imageRows[0] can be an integer from 0 to whatever.</p>

<p>I also have another variable like so:</p>

<pre><code>var count = 15
</code></pre>

<p>I need to pass the count into the imageURL variable... can this be done?</p>

<p>I guessed something like:</p>

<pre><code> var imageURL = &lt;?php echo json_encode($imageRows['count']['URL_Path']); ?&gt;;

 var imageURL = &lt;?php echo json_encode($imageRows[(count)]['URL_Path']); ?&gt;;
</code></pre>

<p>etc but nothings working.</p>

<p>Thanks</p>

<p>Edit:
Answered by Mike Brant.</p>

<p>Thanks</p>
