I have a string in json form which I decode to a php variable. But if the json is not a valid json string, the decode gives a NULL.
I'm looking for a script which can tell me, on which part the decode will fail.
For example I have the following string:
{
"error": "OK",
"pathlist": [
{
"path": "datu5"
"pathId": "10100010"
},
{
"path": "datum",
"pathId": "10100011"
}
]
}
Then I want to show that the error is an error near line 4: For example:
Error: Parse error on line 4:
... "path" : "datu5" "pathId" : "10100010
----------------------^
Expecting 'EOF', '}', ':', ',', ']', got 'STRING'
I there such a php script?
"path": "datu5", "pathId": "10100010"batwan datu5 and pathId