cakephp访问数组视图中

时间:2013-09-25 14:22:32

标签: php cakephp multidimensional-array

我有一个如下所示的数组:

Array
(
    [0] => Array
        (
            [Project] => Array
                (
                    [id] => 3
                    [title] => Title001
                    [created] => 0000-00-00 00:00:00
                    [modified] => 2013-08-05 17:39:07
                )

            [Keyword] => Array
                (
                    [0] => Array
                        (
                            [id] => 1
                            [project_id] => 3
                            [title] => Num1
                            [demand] => 50000000000
                            [competition] => 37889.56700
                            [cpc] => 676.50
                            [created] => 2013-06-26 17:54:48
                            [modified] => 2013-09-19 13:37:25
                        )

                    [1] => Array
                        (
                            [id] => 13
                            [project_id] => 3
                            [title] => test
                            [demand] => 314
                            [competition] => 2341.00000
                            [cpc] => 9999.99
                            [created] => 2013-09-16 11:05:12
                            [modified] => 2013-09-16 11:05:12
                        )
                )
        )

    [1] => Array
        (
            [Project] => Array
                (
                    [id] => 4
                    [title] => Erdmann
                    [created] => 0000-00-00 00:00:00
                    [modified] => 
                )

            [Keyword] => Array
                (
                    [0] => Array
                        (
                            [id] => 3
                            [project_id] => 4
                            [title] => Num5
                            [demand] => 76534000000
                            [competition] => 5555.55560
                            [cpc] => 99.34
                            [created] => 2013-06-26 17:54:48
                            [modified] => 2013-09-19 13:37:36
                        )

                    [1] => Array
                        (
                            [id] => 4
                            [project_id] => 4
                            [title] => Num anything
                            [demand] => 84000
                            [competition] => 8765.62340
                            [cpc] => 543.83
                            [created] => 2013-06-26 17:54:48
                            [modified] => 2013-09-11 12:08:50
                        )
                )
        )

    [2] => Array
        (
            [Project] => Array
                (
                    [id] => 5
                    [title] => Value
                    [created] => 2013-09-11 11:18:22
                    [modified] => 2013-09-11 11:18:22
                )

            [Keyword] => Array
                (
                    [0] => Array
                        (
                            [id] => 2
                            [project_id] => 5
                            [title] => foo
                            [demand] => 4500000000
                            [competition] => 876.78500
                            [cpc] => 66.67
                            [created] => 2013-06-26 17:54:48
                            [modified] => 2013-09-19 13:37:32
                        )

                    [1] => Array
                        (
                            [id] => 5
                            [project_id] => 5
                            [title] => bar
                            [demand] => 5000568
                            [competition] => 667.56543
                            [cpc] => 667.60
                            [created] => 2013-06-26 17:54:48
                            [modified] => 2013-09-11 12:08:09
                        )
                )
        )

    [3] => Array
        (
            [Project] => Array
                (
                    [id] => 6
                    [title] => wolrd.net
                    [created] => 2013-09-16 11:23:42
                    [modified] => 2013-09-16 11:23:42
                )

            [Keyword] => Array
                (
                    [0] => Array
                        (
                            [id] => 15
                            [project_id] => 6
                            [title] => Earth
                            [demand] => 5363
                            [competition] => 93479.34000
                            [cpc] => 5599.99
                            [created] => 2013-09-16 11:25:15
                            [modified] => 2013-09-16 11:26:15
                        )
                )
        )
)

使用所有关键字访问Title001的正确方法是什么?

0 个答案:

没有答案