Skip to content

Instantly share code, notes, and snippets.

@jfsimon
Created March 7, 2013 10:06
Show Gist options
  • Save jfsimon/5106941 to your computer and use it in GitHub Desktop.
Save jfsimon/5106941 to your computer and use it in GitHub Desktop.
// fix previously broken serialized arrays content lengths
$content = preg_replace_callback(
'/s:(\d+):"(.*?)";/e',
function (array $matches) {
return sprintf('s:%s:"%s";', strlen($matches[1]), $matches[1]);
},
$content
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment