{"data":{"tokenId":"cbad508f88a2a8ff47c75426338026de"},"success":true,"error":{"errorCode":"200","errorMsg":"successfully"}}
{"referredBy":"Dvbrhhv","deviceId":"488014664955832","msisdn":"8358808909"}
我想在php中只回显一下来自这个数据的tokenId我怎么能开始友好地帮助我
答案 0 :(得分:1)
json
不是valid json
,请this link
$json='{
"data": {
"tokenId": "cbad508f88a2a8ff47c75426338026de"
},
"success": true,
"error": {
"errorCode": "200",
"errorMsg": "successfully"
}
}';
$json=json_decode($json);
echo $json->data->tokenId;
使用json_decode
Demo
答案 1 :(得分:0)
你可以得到它
$jsonResult = json_decode($json ,true);
echo $jsonResult['data']['tokenId'];
您可以看到result
<br/>
输出:cbad508f88a2a8ff47c75426338026de