Retire el espacio y la línea de JSON en PHP
$before = '{ "key": "value with whitespaces to maintain" }';
$after = json_encode(json_decode($before));
Ankur
$before = '{ "key": "value with whitespaces to maintain" }';
$after = json_encode(json_decode($before));