We are developing an API with the ZEND Framework. Here is an example response
$this->getResponse()
->setHttpResponseCode(200)
->appendBody($this->_helper->json($client->toArray()));
I imagined $this->_helper->json would return a JSON string but its returning an array (in the dev environment).
I now have the staging server to play with and the very same code is returning JSON strings.
The dev environment is currently a different PHP version (dev is 5.3.1, staging is 5.3.3) is this the cause? Do these different versions encode JSON differently? Any idea why this is happening?