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