0
變量我使用的是充電API。 API以Json格式接收響應。我需要從PHP中的Json響應中的變量中存儲輸出值。獲取引起從JSON輸出
// Response received from API url
$output = '{"data":[{"user":"abcd123","bal":"500","error_code":200,"resText":"Success"}]}';
//Decoding output
$json = json_decode($output, true);
//Print
print_r($json);
//Store a value as variable
$bal = $json['bal'];
獲取錯誤BAL是不確定的指數。
請幫我用正確的方式來獲得從API響應變量$ BAL的BAL值。
'print_r($ json);'並遵循結構。 – AbraCadaver