PHP » GoLang |
login |
register |
about
|
GoLang json_last_error
request it (449)
GoLang replacement for PHP's json_last_error
[edit | history]
json_last_error(PHP 5 >= 5.3.0, PHP 7) json_last_error — Returns the last error occurred Description
int json_last_error
( void
)
Returns the last error (if any) occurred during the last JSON encoding/decoding. 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
<?php 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()
<?php The above example will output: string(4) "null" bool(true) See Also
|
more
Recently updated
more
Most requested
more
Last requests
|