#!/bin/env php
<?php
$raw = file_get_contents('php://stdin');
$decoded = json_decode($raw);
echo $decoded === null ? $raw : json_encode($decoded, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
echo PHP_EOL;
#!/bin/env php
<?php
$raw = file_get_contents('php://stdin');
$decoded = json_decode($raw);
echo $decoded === null ? $raw : json_encode($decoded, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
echo PHP_EOL;
Comments