可使用getContent()方法输出数组格式:
$json = json(['code'=>1, 'msg'=>'操作成功']); //json对象
// print_r($json);
$res = json_decode($json->getContent(), true); //数组格式
print_r($res);
可使用getContent()方法输出数组格式:
$json = json(['code'=>1, 'msg'=>'操作成功']); //json对象
// print_r($json);
$res = json_decode($json->getContent(), true); //数组格式
print_r($res);