json_last_errorReturns the last error occurred Description
int json_last_error()
Returns the last error (if any) occurred during the last JSON encoding/decoding,
which did not specify ParametersThis function has no parameters. Return ValuesReturns an integer, the value can be one of the following constants:
Examples
Example #1 json_last_error example
The above example will output: Decoding: {"Organization": "PHP Documentation Team"} - No errors Decoding: {'Organization': 'PHP Documentation Team'} - Syntax error, malformed JSON
Example #2 json_last_error with json_encode
The above example will output: string(4) "null" bool(true)
Example #3 json_last_error and
The above example will output: bool(true) See Also
|