title: PHP arrays be outputed to JSON format
body: <p>PHP arrays</p>
  
  <pre><code>$grades = array( array( name =&gt; "tom", 
                    grade =&gt; 'A'
  
                  ),
             array( name =&gt; "jeff", 
                    grade=&gt; 'B'
  
                  ),
             array( name =&gt; "lisa", 
                    grade =&gt; 'C'
                  )
           );
  
  $output=array
  (  'status'=&gt;'ok',
     'content'=&gt;$grades
  )
  </code></pre>
  
  <p>And the final JSON output I want to see would be <code>{"status":'ok',"content":"{"tom":"A","jeff":"B","lisa":"B"}"}</code></p>
  
  <p><em><strong>The question is how should I manipulated the array so it can give me the final output like above JSON?</em></strong>
  would <code>json_encode($output); echo $output</code> do the trick?
  or<br>
  Do I have to do </p>
  
  <p><code>json_encode($grades)</code>   then another <code>json_encodes($output)</code> but I am seeing extra <code>\</code> thing like <code>{"status":1,"content":"{\"tom\":\"A\",\"jeff\":\"B\",\"lisa\":\"B\"}"}</code> </p>