serialize or convert array to strings? |
[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
[eluser]danmontgomery[/eluser]
That's exactly what those functions are intended for, converting an array/object to a string.
[eluser]Victor Michnowicz[/eluser]
Also have a look at json_encode. It may be faster. |
Welcome Guest, Not a member yet? Register Sign In |