You should use `[json_last_error](http://www.php.net/manual/en/function.json-last-error.php)` and handle errors.