json如何用php格式化输出

//json串
$json='{"scenes":[{"scene":"\/v\/vegetable_garden 194","score":0.382486433,"name":"\u83dc\u5703"},{"scene":"\/o\/orchard 131","score":0.255450219,"name":"\u679c\u56ed\r\n"}],"objects":[{"objectName":"n07720875 bell pepper","score":0.397554934,"bBox":"[0:0:799:527]","name":"\u67ff\u5b50\u6912\r\n"}]}';

$jsonArr=json_decode($json,true);

$jsonObj=json_encode($jsonArr,JSON_D_UNICODE|JSON_PRETTY_PRINT);

print_r($jsonObj);die;

你可能感兴趣的:(json,格式化)