在PHP Multidimensional数组中搜索键并获取其值

时间:2015-04-09 09:50:39

标签: php arrays multidimensional-array

我有一个名为$array的数组,其中包含以下数据

Array(
    [0] => Array(
        [month_count] => January
        [atmos_gb] => 4
        [atmos_h3] => 16
        [waterh3_river] => 8
        [waterh3_pond] => 1
    )
    [1] => Array(
        [month_count] => February
        [atmos_gb] => 4
        [atmos_h3] => 8
        [waterh3_river] => 5
        [waterh3_pond] => 0
    )
    [2] => Array(
        [month_count] => March
        [atmos_gb] => 5
        [atmos_h3] => 7
        [waterh3_river] => 5
        [waterh3_pond] => 0
    )
    [3] => Array(
        [month_count] => April
        [atmos_gb] => 0
        [atmos_h3] => 2
        [waterh3_river] => 2
        [waterh3_pond] => 0
    )
)

我想获得特定单元格的值,比如[2][atmos_gb]

如何获得此值?

0 个答案:

没有答案