Skip to content

Instantly share code, notes, and snippets.

@saltandvinegarcrisps
Last active February 9, 2019 01:29
Show Gist options
  • Save saltandvinegarcrisps/f2abf620c7747c49119d to your computer and use it in GitHub Desktop.
Save saltandvinegarcrisps/f2abf620c7747c49119d to your computer and use it in GitHub Desktop.
<?php
function mb_unserialize($string) {
$string = preg_replace_callback('#s:\d+:"(.*?)";#s', function($matches) { return sprintf('s:%d:"%s";', strlen($matches[1]), $matches[1]); }, $string);
return unserialize($string);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment