Json_encode and serialize can make the array into a string into the database, two which is more convenient and efficient?
Reply content:
Json_encode and serialize can make the array into a string into the database, two which is more convenient and efficient?
It is recommended to use json
standard format storage, which is not only convenient for making APIs but also available directly to other systems.
JSON is the most popular data storage format, the API is generally used json;serilize words, before in use, occasionally there will be a bug, that is, when the value of a certain character Fushiru semicolon, quotation marks, etc., will make unserialize () The result of a problem.
Good with JSON, encoding and decoding efficiency is higher than serialize, and the generated encoding content is less than serialize, more critical is to reduce the unserialize caused by a variety of inexplicable errors