Skip to content

Instantly share code, notes, and snippets.

@msonnabaum
Created July 22, 2015 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msonnabaum/aa829416818754908c99 to your computer and use it in GitHub Desktop.
Save msonnabaum/aa829416818754908c99 to your computer and use it in GitHub Desktop.
#!/usr/bin/env php
<?php
$file_contents = file_get_contents("php://stdin");
$data = unserialize($file_contents);
$results = [];
foreach ($data as $key => $values) {
list($caller, $callee) = explode('==>', $key);
$values["callee"] = $callee;
$values["caller"] = $caller;
$results[] = $values;
}
print json_encode($results, JSON_PRETTY_PRINT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment