I'm having some trouble when I try to use php's JSON encode function
what I'm doing:
echo json_encode($ppar, JSON_PRETTY_PRINT);
now the variable $ppar is an associative array with a whole bunch of data in it. I can get it to work with out the added parameter, but not with it, and when I looked up on php.net it does say there that the 2nd parameter is valid so I don't get what I'm doing wrong.
this works (except for the fact everything is squished together):
echo json_encode($ppar);
but this:
echo json_encode($ppar, JSON_PRETTY_PRINT);
gives me this error:
Warning: json_encode() expects exactly 1 parameter, 2 given in /home/www/mysite/pp.php on line 10
and the output is null. I've been going to this for reference: http://php.net/manual/en/function.json-encode.php