title: How to make a java script array from php array?
body: <p>Iam using PHP,Smarty configuration.</p>
  
  <p>Iam getting an array in PHP and sent it to tpl.I would like to make a javascript array in tpl from that php array.</p>
  
  <p>PHP ARRAY</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [dt] =&gt; 2011-12-02
              [number] =&gt; 3
          )
  
      [1] =&gt; Array
          (
              [dt] =&gt; 2011-12-05
              [number] =&gt; 3
          )
  
      [2] =&gt; Array
          (
              [dt] =&gt; 2011-12-07
              [number] =&gt; 2
          )
  
  )
  </code></pre>
  
  <p>and I want to get it as a java script array in tpl</p>
  
  <pre><code>s1 = [[[2011-12-02, 3],[2011-12-05,3],[2011-12-07,2]]]; 
  </code></pre>