這是我的數(shù)據(jù):$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"}];我想要做的是在這個數(shù)組內(nèi)循環(huán)并能夠獲取數(shù)組內(nèi)每個對象的第一個值和第二個值
1 回答

慕雪6442864
TA貢獻(xiàn)1812條經(jīng)驗(yàn) 獲得超5個贊
<?php
foreach($data as $entry) {
foreach($entry as $key => $value) {
echo "Key: " . $key . "<br>Value: " . $value . "<br><br>";
}
}
?>
- 1 回答
- 0 關(guān)注
- 134 瀏覽
添加回答
舉報
0/150
提交
取消