如何访问这种类型的PHP数组?

时间:2014-10-05 14:28:08

标签: php arrays

我怎么能访问这种类型的php数组?例如,我想从数据数组中的每个数组中获取时间值

(每个数组都以不同的名称开头,并且总是更改它可以是' AK7FJAIEVBCA6'或者#PNAYN6JEB9VSJ2'等等。)

Array (
    [test] => 1
    [data] => Array (
        [Changing_value1] => Array (
        [now] => 1
        [time] => 10000
        )
        [Changing_value2] => Array (
        [now] => 1
        [time] => 10000
        )
        [Changing_value3] => Array (
        [now] => 1
        [time] => 10000
        )
    )
)

1 个答案:

答案 0 :(得分:1)

$array['data'][0]['time']

或迭代它

foreach($array['data'] as $data) {
   $time = $data['time'];
}