pass php array to javascript function
<p>i am trying to get php array variable into javascript variable.</p>

<p>this is my code:</p>

<p>
      </p>

<pre><code>&lt;script type="text/javascript"&gt;

      function drawChart(row,day,week,month,date) 
      {
     // some code...
      }
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;?php

for($counter = 0; $counter&lt;count($au); $counter++)
{
        switch($au[$counter]-&gt;id)
        {
            case pageID.'/insights/page_active_users/day':
                $day[] = $au[$counter]-&gt;value;
            break;
            case pageID.'/insights/page_active_users/week':
                $week[] = $au[$counter]-&gt;value;
            break;
            case pageID.'/insights/page_active_users/month':
                $month[] = $au[$counter]-&gt;value;
            break;
        }

}
?&gt;


&lt;script&gt;
    drawChart(600/50, '&lt;?php echo $day; ?&gt;', '&lt;?php echo $week; ?&gt;', '&lt;?php echo $month; ?&gt;', '&lt;?php echo createDatesArray(cal_days_in_month(CAL_GREGORIAN, date('m',strtotime('-1 day')), date('Y',strtotime('-1 day')))); ?&gt;');

&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>i can't get value of the php array.</p>

<p>plz anyone help me.</p>
