Created
July 4, 2014 17:22
-
-
Save jyc/5150a01ec7a655c656d1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| switch (json_last_error()) { | |
| case JSON_ERROR_NONE: | |
| echo ' - No errors'; | |
| break; | |
| case JSON_ERROR_DEPTH: | |
| echo ' - Maximum stack depth exceeded'; | |
| break; | |
| case JSON_ERROR_STATE_MISMATCH: | |
| echo ' - Underflow or the modes mismatch'; | |
| break; | |
| case JSON_ERROR_CTRL_CHAR: | |
| echo ' - Unexpected control character found'; | |
| break; | |
| case JSON_ERROR_SYNTAX: | |
| echo ' - Syntax error, malformed JSON'; | |
| break; | |
| case JSON_ERROR_UTF8: | |
| echo ' - Malformed UTF-8 characters, possibly incorrectly encoded'; | |
| break; | |
| default: | |
| echo ' - Unknown error'; | |
| break; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment