Last active
June 25, 2020 19:43
-
-
Save alexclst/fc01fb7542276cfa7560e4b4c962854a to your computer and use it in GitHub Desktop.
BBEdit text filter to unserialize WP data into pretty JSON.
This file contains 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/local/bin/php | |
<?php | |
// unserialize input | |
$data = unserialize(trim(fgets(STDIN))); | |
// print it as pretty unescaped json | |
echo json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment