Skip to content

Instantly share code, notes, and snippets.

@Berdir
Created February 6, 2014 16:57
Show Gist options
  • Save Berdir/8848201 to your computer and use it in GitHub Desktop.
Save Berdir/8848201 to your computer and use it in GitHub Desktop.
Serialize dumper
$content = file_get_contents('file_with_serialized_string.txt');
$len = strlen($content);
//$len = 10000;
$depth = 0;
for ($i = 0; $i < $len; $i++) {
$char = $content[$i];
print $char;
if ($char == '{') {
$depth++;
print "\n" . str_repeat(' ', $depth);
}
if ($char == '}') {
$depth--;
print "\n" . str_repeat(' ', $depth);
}
if ($char == ';') {
print "\n" . str_repeat(' ', $depth);
}
}
print "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment