Skip to content

Instantly share code, notes, and snippets.

@alexclst
Last active June 25, 2020 19:43
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 alexclst/fc01fb7542276cfa7560e4b4c962854a to your computer and use it in GitHub Desktop.
Save alexclst/fc01fb7542276cfa7560e4b4c962854a to your computer and use it in GitHub Desktop.
BBEdit text filter to unserialize WP data into pretty JSON.
#! /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