I have a large JSON file returned from a web service. I am using json_last_error() to get the error code, but would like to know which string is giving the error so that I can design a regex for it. How would I return the string giving the error?
1 Answer
I know I'm late, but I was researching about this and my solution was this library: https://github.com/Seldaek/jsonlint
With this library you can check the syntax of a JSON string and it gives you more detail than json_last_error() method do.