Skip to content

Instantly share code, notes, and snippets.

@jamesasu
Created August 19, 2020 05:11
Show Gist options
  • Save jamesasu/a774d88ccfa15709a5f7f4f313963894 to your computer and use it in GitHub Desktop.
Save jamesasu/a774d88ccfa15709a5f7f4f313963894 to your computer and use it in GitHub Desktop.
#!/usr/bin/env php
<?php
if (isset($argv[1])) {
$contents = file_get_contents($argv[1]);
echo json_encode(unserialize($contents));
} else {
echo "Usage: unserialize [FILENAME]\n\nExamples:\n\tunserialize myfile.txt\n\tOR\n\tunserialize myfile.txt > myfile.json\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment