JSON与数据库中的序列化数组 [英] JSON vs. Serialized Array in database

查看:186
本文介绍了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.
  1. JSON encode() & decode()
    • PHP Version >= 5.0.0
      • Nesting Limit of 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与数据库中的序列化数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆