【发布时间】:2021-09-14 04:35:19
【问题描述】:
我已从服务器获取 json 数据并使用 json_decode(value, true); 进行解码
使用 print_r 函数我得到这个数组作为输出
Array
(
[id] => 120
[key] => 7ca04960a36dbb7f4b7c8607bb3
[num] => 0
)
Array
(
[id] => 121
[key] => 7ca04960a36dccgki49g6dfg57
[num] => 0
)
我想使用 while 循环显示解码数据。
while($row = mysqli_fetch_assoc($result)) {
$json = json_decode($row['post_req'], true);
echo "<pre>";
print_r($json);
echo "</pre>";
}
例如:
id = 120,
key = 7ca04960a36dbb7f4b7c8607bb3,
num = 0
如何打印数据?
【问题讨论】:
标签: php arrays json arraylist echo