title: transforming array into json - smarty
body: <p>Suppose I have an array (dynamically generated from my php code)</p>
  
  <pre><code>array (size=4)
    0 =&gt; 
      array (size=1)
        'Sat' =&gt; string '6' (length=1)
    1 =&gt; 
      array (size=1)
        'Sun' =&gt; string '10' (length=2)
  </code></pre>
  
  <p>and I want to get the following to put it inside a javascript variable</p>
  
  <pre><code>        {
              "x": 'Sat',
              "y": 6
          }{
              "x": 'Sun',
              "y": 10
          }
  </code></pre>
  
  <p>How can I achieve that ?</p>