i'm using serialize/unserialize functions in php 5.2. the text to be stored is POSTed via a form. btw, no white-space before or after. if text contains " or ' it serializes successfully. the problem is it does not unserialize back. what i'm doing wrong?
David Walsh has a simple solution:
//to safely serialize
$encoded_serialized_string = base64_encode(serialize($your_array));
//to unserialize
$array_restored = unserialize(base64_decode($encoded_serialized_string));
http://davidwalsh.name/php-serialize-unserialize-issues
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With