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

WBOY
Release: 2016-06-13 11:52:28
Original
1079 people have browsed it

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) {<br />  echo $r[0]['k'];<br />}
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!