Skip to content

Instantly share code, notes, and snippets.

@tagrudev
Created October 10, 2012 13:58
Show Gist options
  • Save tagrudev/3865808 to your computer and use it in GitHub Desktop.
Save tagrudev/3865808 to your computer and use it in GitHub Desktop.
/**
* Mulit-byte Unserialize
*
* UTF-8 will screw up a serialized string
*
* @access private
* @param string
* @return string
*/
function mb_unserialize($string) {
$string = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $string);
return unserialize($string);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment