Answer the question
In order to leave comments, you need to log in
Tell me the JSON parser in PHP
Good afternoon.
There is the following string in JSON format: {ench: [{id: 16s, lvl: 5s}]}
The built-in function json_decode() does not take it (I read that it is very picky about the format of the json string). Please tell me a json parser in php that can digest it or how to bring this string into an "edible" form for the built-in php function.
Answer the question
In order to leave comments, you need to log in
Do you receive invalid json from yourself or from some external source? I mean, what can all such json fix?
I get it from my source. The java library generates such a string. I already then take it from a DB.
What is stupidity? Write your own parser - you should get a simple function with several nested loops.
I know from experience that PHP has a good parser and you don't need to touch it. If the data source belongs to you, then it would be better to generate a valid format right away. Look for alternative json encoding libraries you use.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question