note 73510 deleted from function.unserialize by aharvey

From: Date: Tue, 06 Nov 2012 01:30:20 +0000
Subject: note 73510 deleted from function.unserialize by aharvey
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-191706@lists.php.net to get a copy of this message
Note Submitter: julabz at laposte dot net ---- I couldn't get it with all these solutions, but it worked for me by mixing some of them this way: <?php function __serialize($object) { $serialized = serialize($object); return htmlentities($serialized,ENT_QUOTES); } // function __unserialize($string) { $unserialized = stripslashes($string); $unserialized = preg_replace('!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':\"$2\";'", $unserialized ); return unserialize($unserialized); } ?>

« previous php.notes (#191706) next »