变量$ res在
下面返回此响应nbb=[1.2,1.7]
v = 0.5
如何在邮件中访问此ID?
{"Status":"Success","Message":{"Id":"9235948e-5469-450e-8aaf-551772da9c6a"}}
答案 0 :(得分:2)
像这样:
$res = '{"Status":"Success","Message":{"Id":"9235948e-5469-450e-8aaf-551772da9c6a"}}';
$resArr = json_decode($res, true); // true is needed to make the output array associative.
print_r($resArr['Message']['Id']);
使用json_decode()
将json字符串转换为php数组。
答案 1 :(得分:1)
试试这个:
$result = json_decode($res,true);<br/>
$id = $result['Message']['Id']