I'm not getting the json_encode to work in my php file. Like for instance, I tried this example I got from php.net
<?php
$arr = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5);
echo json_encode($arr);
?>
But nothing works. If i remove the echo statement, then my php works, which means php isn't recognizing the json_encode code.
I'm using PHP 5.4.16. To sum it up, I'm using xampp 1.8.2.
Help please?
json_last_error()to see what error you're getting. php.net/manual/en/function.json-last-error.phpini_set('display_errors', 1); error_reporting(-1);to the top of your file.