Serialize or Implode

前端 未结 1 1958
無奈伤痛
無奈伤痛 2020-12-31 17:44

I need to store lots of two-dimensional arrays inside database and was not sure what to use: serialize or implode. So I did a few tests, to find ou

相关标签:
1条回答
  • 2020-12-31 18:32

    My idea is that explode/implode operate on strings that's why, while serialize/unserialize output/input a string at the very ending/beginning. Probably the more strings you implode and the longer string you explode, the slower it is, have you tried?

    Which to use I don't know, it depends if you later wish to handle output string, I think serialized string is more difficult to parse. But to store it in database or file I'd use serialize.

    0 讨论(0)
提交回复
热议问题