json_encode returning "NULL" then the json

Here is the relevant part of the code. Pretty basic…

[php]
$json = array(“hello” => “Chrissy”);
$json1 = json_encode($json);
$this->response->setOutput($json1);
[/php]

And instead of getting the expected, I get absolutely no output when I json_decode and the following when I call the code in my browser.

NULL {"hello":"Chrissy"}

I’m pretty new with PHP and Json but I really don’t know what’s going on.

Sponsor our Newsletter | Privacy Policy | Terms of Service