mysql - Is there a more efficient way to save an Array to SQL than PHP function serialize()? -


possible duplicate:
an efficient way save array , keys database

is there maybe serialize() equivalent returns binary?

saving data strings inefficient in both ways: inefficient in manner of performance , memory. there function return pure data ram , accordingly function read back?

if trying more compact representation of serialized string, e.g., 1 uses less space plain serialize(), might use gzdeflate() compress plain-text output:

$data = gzdeflate(serialize($some_array)); // store in database...  // restore array: $data database, then: $array = unserialize(gzinflate($data)); 

instead of gzdeflate()/gzinflate(), can use gzcompress()/gzuncompress(), these produce larger strings include additional metadata such checksum.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -