Created
August 10, 2021 14:52
-
-
Save gbirke/bf8486ff7b50199242dd1d3680ce4c1a to your computer and use it in GitHub Desktop.
Decode PHP-serialized and base64 encoded data in CLI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
if (!empty($argv[1])) { | |
$data = (string)$argv[1]; | |
} elseif (!stream_isatty(STDIN)) { | |
$data = stream_get_contents(STDIN); | |
} else { | |
echo "Usage: $argv[0] <base64_encoded_serialized_data>\n"; | |
exit(1); | |
} | |
var_dump(unserialize(base64_decode($data))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment