title: How do I encode a PHP array to a JSON array, not object?
body: <p>I am trying to json_encode an array which is returned from a Zend_DB query.</p>
  
  <p>var_dump gives: (Manually adding 0 member does not change the picture.)</p>
  
  <pre><code>array(3) {
    [1]=&gt;
    array(3) {
      ["comment_id"]=&gt;
      string(1) "1"
      ["erasable"]=&gt;
      string(1) "1"
      ["comment"]=&gt;
      string(6) "test 1"
    }
    [2]=&gt;
    array(3) {
      ["comment_id"]=&gt;
      string(1) "2"
      ["erasable"]=&gt;
      string(1) "1"
      ["comment"]=&gt;
      string(6) "test 1"
    }
    [3]=&gt;
    array(3) {
      ["comment_id"]=&gt;
      string(1) "3"
      ["erasable"]=&gt;
      string(1) "1"
      ["comment"]=&gt;
      string(6) "jhghjg"
    }
  }
  </code></pre>
  
  <p>The encoded string looks like:</p>
  
  <pre><code>{"1":{"comment_id":"1","erasable":"1","comment":"test 1"},
   "2":{"comment_id":"2","erasable":"1","comment":"test 1"},
   "3":{"comment_id":"3","erasable":"1","comment":"jhghjg"}}
  </code></pre>
  
  <p>What I need is:</p>
  
  <pre><code>[{"comment_id":"1","erasable":"1","comment":"test 1"},
  {"comment_id":"2","erasable":"1","comment":"test 1"},
  {"comment_id":"3","erasable":"1","comment":"jhghjg"}]
  </code></pre>
  
  <p>Which is what the php.ini/json_encode documentation says it should look like.</p>