在PHP中需要關於json_decode()
的幫助和建議。我正在處理API調用的CURL操作,返回結果是JSON。我需要訪問字段pgid
的語法是什麼?在PHP上需要幫助json_decode()
捲曲操作
$output = curl_exec($ch);
$rslt = json_decode($output, true);
var_dump($rslt);
的var_dump()
輸出
array (size=1)
'protection-groups' => array (size=3)
0 => array (size=2)
'ppsDropped' => float 0
'pgid' => int 13
1 => array (size=2)
'ppsDropped' => float 7.9957930115316
'pgid' => int 18
2 => array (size=2)
'ppsDropped' => float 5302.7606884163
'pgid' => int 19
你試過的顯示代碼 – Nawin