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
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 serialize
d string is more difficult to parse. But to store it in database or file I'd use serialize
.