The following JSON response returns null using json_decode()
Any ideas why it is invalid, and how can I make it valid to decode.
The following JSON response returns null using json_decode()
Any ideas why it is invalid, and how can I make it valid to decode.
Look at http://jsonlint.com/
Accoring to JSONLint, you have the following error:
Parse error on line 82:
... "text": "Make it easier for
-----------------------^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
The error is with this in the string '\x27s'
The same again for line 92.
"Roger\x27scompanion\x3cem\x3ehelped\x3c/em\x3ehimwiththeren"
Replace them with their appropriate unicode characters or add an extra slash as one slash is escaping your string.
from PHP.net:
NULL is returned if the json cannot be decoded or if the encoded data is deeper than the recursion limit.
perhaps that is the issue?
nullback? You can try cutting it in half, checking both halves. Then each quarter, etc.json_last_error()I gotint(4)which points toJSON_ERROR_SYNTAX Syntax error. Hope it helpsjson_last_error()now.