开发者

access each value of associative array

hello how can i access or echo each element of this associative array

Array
(
    [0] => Array
        (
            [rule] => admin/user
            [title] => Users Management
     开发者_开发知识库       [target] => _parent
            [0] => Array
                (
                    [0] => Array
                        (
                            [rule] => admin/user/add
                            [title] => Add New User
                        )

                )

        )

    [1] => Array
        (
            [rule] => admin/category
            [title] => Category Mangement
            [target] => _parent
            [0] => Array
                (
                    [0] => Array
                        (
                            [rule] => admin/category/add
                            [title] => Add New Category
                        )

                )

        )

)

I want to know which loop will support this and how


I suppose that using array_walk_recursive(), with a callback function that would do an echo, would be quite a good solution.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜