note 76012 deleted from function.unserialize by aharvey
| From: | aharvey@php.net | Date: | Tue, 06 Nov 2012 01:31:50 +0000 |
| Subject: | note 76012 deleted from function.unserialize by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191710@lists.php.net to get a copy of this message | ||
Note Submitter: skinnepa at hotmail dot com
----
props to steve at bluearena dot com and getmequick at gmail dot com
Here's my implementation :p
function mb_unserialize($serial_str) {
$out = preg_replace('!s:(\d+):"(.*?)";!se',
"'s:'.strlen('$2').':\"$2\";'", $serial_str );
return unserialize($out);
}
Works great for serialized UTF-8 content that doesn't like to be unserialized!