note 84730 deleted from function.unserialize by aharvey
| From: | aharvey@php.net | Date: | Tue, 06 Nov 2012 01:35:22 +0000 |
| Subject: | note 84730 deleted from function.unserialize by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191718@lists.php.net to get a copy of this message | ||
Note Submitter: chris at r3i dot it
----
@ Igor for single quote trouble:
<?php
function mb_unserialize($serial_str) {
$out = preg_replace('!s:(\d+):"(.*?)";!se',
"'s:'.strlen('$2').':\"$2\";'", $serial_str );
return unserialize($out);
}
?>
Unserialize with utf8 content get trouble and the code provided by the guy works fine.
Code isn't mine: thanks to http://www.lastfm.pl/user/TheMariner