pass php variable value to javascript
<p>Im trying to pass the value of a php variable into javascript but i just cant get it to work. Am I doing anything wrong? Below is the line of code I'm working with.</p>

<pre><code>var dist = parseInt("&lt;?php echo json_encode($distance); ?&gt;");
</code></pre>
