Guest User

Untitled

a guest
Jun 25th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. <?php
  2. if(empty($argv[1]))
  3. {
  4. die("Syntax: php {$argv[0]} <file>");
  5. }
  6. $json = json_decode(file_get_contents($argv[1]), true);
  7. if($json == NULL)
  8. {
  9. die("ERROR: Invalid JSON.");
  10. }
  11. file_put_contents($argv[1], json_encode($json, JSON_PRETTY_PRINT));
Add Comment
Please, Sign In to add comment