note 71270 deleted from function.unserialize by aharvey
| From: | aharvey@php.net | Date: | Tue, 06 Nov 2012 01:28:14 +0000 |
| Subject: | note 71270 deleted from function.unserialize by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191702@lists.php.net to get a copy of this message | ||
Note Submitter: getmequick at gmail dot com
----
for those who has error like "
error at offset .."
but doesn't know why.
This function might be usefull
<?php
$sObject3 =
'a:2:{i:0;s:1:"1";i:1;s:3654:"1a1dc91c907325c69271ddf0c944bc72";}';
print_r( __unserialize($sObject3 ));
function __unserialize($sObject) {
$__ret =preg_replace('!s:(\d+):"(.*?)";!e',
"'s:'.strlen('$2').':\"$2\";'", $sObject );
return unserialize($__ret);
}
?>