这是我的数据:$data = [{"5": "4"}, {"10": "0"}, {"6": "1"}, {"11": "0"}, {"7": "0"}, {"1": "10"}, {"2": "5"}, {"8": "3"}, {"12": "0"}, {"3": "0"}, {"9": "0"}, {"4": "2"}];我想要做的是在这个数组内循环并能够获取数组内每个对象的第一个值和第二个值
1 回答
慕雪6442864
TA贡献1812条经验 获得超5个赞
<?php
foreach($data as $entry) {
foreach($entry as $key => $value) {
echo "Key: " . $key . "<br>Value: " . $value . "<br><br>";
}
}
?>
- 1 回答
- 0 关注
- 89 浏览
添加回答
举报
0/150
提交
取消