Answer the question
In order to leave comments, you need to log in
What is the best way to organize work with json?
Getting familiar with the json format. I emulate the situation. Instead of a database file with json. Now every function for working with data always starts with json_decode at the input, and is the json_encode return normal? The data that on any should be converted here and there. I just wonder if there is another way?
Answer the question
In order to leave comments, you need to log in
In PHP, you can only convert JSON to an array or object using json_decode. And convert from PHP to JSON only through json_encode.
What exactly are your concerns?
Yes, this is absolutely normal. JSON was invented for this - to transfer information.
If the data is PHP oriented, I recommend using serialize() instead of json_encode(). There are small bonuses in terms of working with objects that are lost when using json_encode ().
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question