本文介绍了JSON 与数据库中的序列化数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 MySQL 数据库中存储 JSON 数据与序列化数组相比有哪些优缺点?

What are the advantages and disadvantages of storing JSON data in MySQL database vs. serialized array?

推荐答案

  1. JSON 编码() &解码()
    • PHP 版本 >= 5.0.0
      • 嵌套限制为 20.
  • 嵌套限制为 128.
  • 嵌套限制为 512.
  • PHP 版本 >= 4.0.0
    • PHP Version >= 4.0.0
      • Methods are not lost on PHP Datatype Object.
      • __wakeup() magic method called on any object being unserialize. (VERY POWERFUL)
      • It has been noted that it is some times best the base64 encode strings put into the database, and base64 decode strings taken out of the database with this function, as there are some issues with the handling of some white space characters.

      选择权在你.

      这篇关于JSON 与数据库中的序列化数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 20:45
查看更多