note 83415 deleted from function.unserialize by aharvey

From: Date: Tue, 06 Nov 2012 01:35:15 +0000
Subject: note 83415 deleted from function.unserialize by aharvey
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-191716@lists.php.net to get a copy of this message
Note Submitter: campbell at vertesi dot com ---- One thing to note - if you're storing your serialized string in a MySQL TEXT field, it will remove the {s and }s that make your string valid for unserialization. I almost killed myself figuring this out - I'm sure it's basic but I had to post my solution - encode the serialized string in base 64. $mood = array('angry','sad','happy'); $storable = base64_encode(serialize($mood)); then when you retrieve it from the database, you can access the string with $mood=base64_decode(unserialize($storable));

« previous php.notes (#191716) next »