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
Post a Comment