 <p>Instead of immediately echoing out the responses, try stacking them an array and then outputting the JSON.</p> <pre><code>&lt;?php //...... $result = arrray(); $result[] = $this-&gt;alerts-&gt;generate(); $result[] = $this-&gt;alerts2-&gt;generate(); echo json_encode($result); </code></pre>