Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(empty($argv[1]))
- {
- die("Syntax: php {$argv[0]} <file>");
- }
- $json = json_decode(file_get_contents($argv[1]), true);
- if($json == NULL)
- {
- die("ERROR: Invalid JSON.");
- }
- file_put_contents($argv[1], json_encode($json, JSON_PRETTY_PRINT));
Add Comment
Please, Sign In to add comment