Retirez l'espace et la ligne 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));