Welcome Guest, Not a member yet? Register   Sign In
serialize or convert array to strings?
#1

[eluser]carvingCode[/eluser]
I'm curious what the thought is on storing array contents to the database?

I've most always converted the array to a string, stored it to the db, and then did the reverse on the way out. Have recently started using 'serialize/unserialize' to do the same.

Using these functions means a lot less overhead, in terms of code I need to maintain. But, my newness to using these functions has me curious if there's any drawbacks I need to know about?

TIA

Randy
#2

[eluser]danmontgomery[/eluser]
That's exactly what those functions are intended for, converting an array/object to a string.
#3

[eluser]Victor Michnowicz[/eluser]
Also have a look at json_encode. It may be faster.




Theme © iAndrew 2016 - Forum software by © MyBB