当前位置:Gxlcms > PHP教程 > php怎么读一个多维数据动态的

php怎么读一个多维数据动态的

时间:2021-07-01 10:21:17 帮助过:18人阅读

php如何读一个多维数据动态的、
Array
(
[3] => Array
(
[0] => Array
(
[seconds] => 16930
[no] => 0
[pt] => 3
[k] => 119981343
[size] => 906330
)

)

[2] => Array
(
[0] => Array
(
[seconds] => 16930
[no] => 0
[pt] => 2
[k] => 119980914
[size] => 472101
)

)

[4] => Array
(
[0] => Array
(
[seconds] => 16930
[no] => 0
[pt] => 4
[k] => 119981696
[size] => 1735787
)

)

[99] => Array
(
[0] => Array
(
[seconds] => 16930
[no] => 0
[pt] => 99
[k] => 119981988
[size] => 679868
)

)

)




我如何读到其内的值,就是no pt k size
这是一个动态数据,就是说3,2,4,99不是固定的,因此不能用此法:[4][0][no]
应该怎么办啊?
------解决方案--------------------
foreach($ar as $r) {
echo $r[0]['k'];
}

------解决方案--------------------
foreach($ar as $r) {
foreach($r as $row){
echo $row['k'];
}
}

人气教程排行