按字段打印数组分开

时间:2017-11-28 07:55:31

标签: arrays drupal

我有这样的数组:

Array
(
    [477] => Array
        (
            [nid] => 477
            [changed] => 1510506071
            [created] => 1510506071
            [title] => mother
            [status] => 1
        )

    [480] => Array
        (
            [nid] => 480
            [changed] => 1510506071
            [created] => 1510506071
            [title] => hello
            [status] => 1
        )

    [481] => Array
        (
            [nid] => 481
            [changed] => 1510506071
            [created] => 1510506071
            [title] => name
            [status] => 1
        )

我需要按字段渲染数组分开并使用print_r($result[''][nid]) OR print_r($ result [] nid)但不起作用!

有关这方面的任何帮助吗?

1 个答案:

答案 0 :(得分:0)

foreach($yourArray as $array){
    print_r(array['nid']);
}