How to assign an php array to a javascript array?
<p>I have an array $lines in php. Currently I want to assign the $lines value to a javascript variable(i.e. chartLines).</p>

<p>The way I assigned the php array to javascript is not correct. </p>

<p>Can anyone help me? Thanks in advance!</p>

<pre><code>&lt;?php
    $line1 = array(array("08:00","20"),array("08:00","16"),array("08:00","19"),array("08:00","17"));

    $line2 = array(array("08:00","45"),array("08:00","47"),array("08:00","49"),array("08:00","47"));

    $lines= array($line1,$line2);  
?&gt;


 &lt;script type="text/javascript"&gt;
    $(function () {

        var chartLines = &lt;?php echo $lines; ?&gt;  

                });
</code></pre>
