I am using a lot of jQuery in a project am working on.
I have a javascript function that makes an ajax request to a controller which returns data in JSON.
I
You MUST only use json_encode($data) once in a response, if you want to output more stuff, you need to merge your data into one array and send that.
EDIT: To be clear, one way you could do it is like this:
echo json_encode(array('pheeds' => $pheeds, 'res' => $res));
Then in JS you will get an array with the keys "pheeds" and "res".
Although it may be of little practical significance, I would also recommend doing this before you echo the json encoded string:
header('Content-Type: application/json');